/* ── Bar module ── */

.bar-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg);
}

/* Topbar */
.bar-topbar {
  background: var(--topbar-bg);
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.bar-back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bar-back-btn:active { opacity: 0.6; }

.bar-topbar__text { flex: 1; }

.bar-topbar__title {
  color: #fff;
  font-size: 17px;
  font-weight: 500;
}

.bar-topbar__sub {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: 2px;
}

.bar-tabs-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--label3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px 6px;
  background: var(--bg2);
}

/* Tabs */
.bar-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg2);
  border-bottom: 0.5px solid var(--sep);
  padding: 0 12px;
  position: sticky;
  top: 80px;
  z-index: 9;
}

.bar-tabs::-webkit-scrollbar { display: none; }

.bar-tab {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--label3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}

.bar-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Cards list */
.bar-cards {
  padding: 10px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Card */
.bar-card {
  background: var(--bg2);
  border-radius: var(--radius-md, 14px);
  border: 0.5px solid var(--sep);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.bar-card__head {
  padding: 13px 14px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bar-card__head:active { opacity: 0.7; }

.bar-card__info { flex: 1; min-width: 0; }

.bar-card__name {
  font-size: 15px;
  font-weight: 500;
  color: var(--label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-card__sub {
  font-size: 12px;
  color: var(--label3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.bar-card__chevron {
  color: var(--label3);
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-card.open .bar-card__chevron { transform: rotate(180deg); }

/* Diff badge */
.bar-diff {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.diff-easy { background: rgba(52,199,89,0.12); color: #1a7a34; }
.diff-med  { background: rgba(255,149,0,0.12);  color: #a05c00; }
.diff-hard { background: rgba(255,59,48,0.12);  color: #a0201a; }

[data-theme="dark"] .diff-easy { background: rgba(52,199,89,0.18); color: #34c759; }
[data-theme="dark"] .diff-med  { background: rgba(255,149,0,0.18);  color: #ff9500; }
[data-theme="dark"] .diff-hard { background: rgba(255,59,48,0.18);  color: #ff453a; }

/* Rating pill */
.bar-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--label2);
  white-space: nowrap;
}

.bar-rating-pill .ti-star { font-size: 12px; color: #ff9500; }
.bar-rating-pill--empty .ti-star { color: var(--label3); }

/* Card body */
.bar-card__body {
  padding: 0 14px 14px;
  border-top: 0.5px solid var(--sep);
}

.bar-ing-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--label3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 12px 0 6px;
}

.bar-ing-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 0.5px solid var(--sep);
  font-size: 14px;
}

.bar-ing-row:last-of-type { border-bottom: none; }

.bar-ing-name { color: var(--label); }
.bar-ing-qty  { color: var(--label3); font-size: 13px; }

.bar-method {
  background: var(--bg3);
  border-radius: var(--radius-sm, 10px);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--label2);
  line-height: 1.55;
  border: 0.5px solid var(--sep);
}

/* Rating stars */
.bar-rate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.bar-rate-label {
  font-size: 13px;
  color: var(--label3);
}

.bar-stars {
  display: flex;
  gap: 4px;
}

.bar-star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  font-size: 20px;
  color: var(--sep);
  transition: color 0.1s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.bar-star .ti { font-size: 20px; }
.bar-star.on .ti { color: #ff9500; }
.bar-star:active { transform: scale(1.3); }

/* Comments */
.bar-comments {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bar-comment {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--sep);
}

.bar-comment:last-child { border-bottom: none; }

.bar-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.bar-comment__body { flex: 1; min-width: 0; }

.bar-comment__text {
  font-size: 13px;
  color: var(--label2);
  line-height: 1.4;
  word-break: break-word;
}

.bar-comment__author {
  font-size: 11px;
  color: var(--label3);
  margin-top: 3px;
}

/* Add comment */
.bar-add-comment {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.bar-comment-input {
  flex: 1;
  background: var(--bg2, var(--bg));
  border: 0.5px solid var(--sep);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--label);
  outline: none;
  -webkit-appearance: none;
}

.bar-comment-input::placeholder { color: var(--label3); }
.bar-comment-input:focus { border-color: var(--accent); }

.bar-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bar-send-btn:active { opacity: 0.7; }
.bar-send-btn .ti { font-size: 15px; }
