/* ☘️ Lucky Hub */
.hub-page { max-width: 100%; }
.hub-head-btns { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.hub-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.hub-tab {
  border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 6px 12px;
  font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--ink);
}
.hub-tab:hover { border-color: #43b36f; }
.hub-tab.on { background: #43b36f; border-color: #43b36f; color: #fff; font-weight: 600; }
.hub-count { font-size: 0.72rem; opacity: 0.7; font-weight: 500; }
.hub-note { background: #fff8e6; border: 1px solid #f1d58a; color: #6b5200; border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; margin-bottom: 10px; }

.hub-toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hub-toolbar input[type=search] { flex: 1 1 240px; max-width: 360px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.9rem; background: var(--panel); }
.hub-filter { display: flex; flex-direction: column; font-size: 0.7rem; color: var(--muted); gap: 2px; }
.hub-filter select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem; background: var(--panel); max-width: 220px; }
.hub-shown { font-size: 0.8rem; color: var(--muted); padding-bottom: 8px; }

.hub-table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 230px); }
.hub-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.hub-table th {
  position: sticky; top: 0; background: #faf9f6; text-align: left; font-weight: 600; font-size: 0.75rem; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none; z-index: 1;
}
.hub-table th:hover { color: var(--ink); }
.hub-table td { padding: 7px 10px; border-bottom: 1px solid #f0eee9; vertical-align: top; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.hub-table tbody tr { cursor: pointer; }
.hub-table tbody tr:hover td { background: #f6fbf8; }
.hub-table tbody tr.open td { background: #e9f6ee; }
.hub-td-title { font-weight: 600; min-width: 220px; max-width: 420px !important; }
.hub-td-money, .hub-th-money { text-align: right; white-space: nowrap; }
.hub-td-date { white-space: nowrap; }
.hub-td-bool { text-align: center; }
.hub-check { color: #2e9c5c; font-weight: 700; }
.hub-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: #f4f3ef; font-size: 0.75rem; white-space: nowrap; margin: 1px 0; }
.hub-link { color: var(--accent); text-decoration: none; white-space: nowrap; }
.hub-link:hover { text-decoration: underline; }
.hub-linkcount { color: #2b6a45; }
.hub-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.15); vertical-align: -2px; margin-right: 6px; }
.hub-more { text-align: center; padding: 12px; }

/* Record panel */
.hub-drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.12); z-index: 40; }
.hub-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); z-index: 41;
  border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0,0,0,0.08); overflow-y: auto; padding: 14px 18px 30px;
}
.hub-drawer-head { display: flex; align-items: center; justify-content: space-between; }
.hub-drawer-kind { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hub-x { border: none; background: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; }
.hub-title-input { width: 100%; font-size: 1.2rem; font-weight: 700; border: 1px solid transparent; border-radius: 6px; padding: 6px; margin: 4px 0 6px -6px; resize: none; font-family: inherit; background: transparent; color: var(--ink); }
.hub-title-input:hover, .hub-title-input:focus { border-color: var(--border); background: #fff; outline: none; }
.hub-section { border-top: 1px solid var(--border); padding: 10px 0 4px; }
.hub-section:first-of-type { border-top: none; }
.hub-section-title { font-size: 0.72rem; font-weight: 700; color: #2b6a45; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.hub-field { margin-bottom: 9px; }
.hub-field > label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 3px; }
.hub-field input[type=text], .hub-field input[type=url], .hub-field input[type=date], .hub-field select, .hub-field textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.88rem; font-family: inherit; background: #fff; color: var(--ink);
}
.hub-field textarea { resize: vertical; min-height: 36px; line-height: 1.4; }
.hub-field input:focus, .hub-field select:focus, .hub-field textarea:focus { outline: 2px solid #43b36f55; border-color: #43b36f; }
.hub-url-row { display: flex; gap: 6px; align-items: center; }
.hub-url-row a.btn { white-space: nowrap; text-decoration: none; color: var(--ink); }
.hub-bools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.hub-bool { display: flex; align-items: center; gap: 7px; font-size: 0.85rem; cursor: pointer; padding: 3px 0; }
.hub-bool input { width: 16px; height: 16px; accent-color: #43b36f; }
.hub-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; position: relative; }
.hub-chip { display: inline-flex; align-items: center; gap: 2px; background: #f1f7f3; border: 1px solid #cfe7d8; border-radius: 999px; padding: 2px 4px 2px 9px; font-size: 0.8rem; max-width: 100%; }
.hub-chip a { color: #2b6a45; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.hub-chip a:hover { text-decoration: underline; }
.hub-chip button { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 0.95rem; line-height: 1; padding: 0 3px; }
.hub-chip button:hover { color: #d33; }
.hub-field .hub-chip-input { border: 1px dashed var(--border); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; width: 120px; background: #fff; }
.hub-picker { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,0.12); padding: 6px; }
.hub-picker input { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.88rem; }
.hub-picker-list { max-height: 260px; overflow-y: auto; margin-top: 4px; }
.hub-picker-item { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.hub-picker-item:hover { background: #eef7f1; }
.hub-tpt { background: #f8faf8; border: 1px solid #e3ede6; border-radius: 8px; padding: 6px 10px; margin: 2px 0 8px; }
.hub-tpt-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 0.85rem; }
.hub-tpt-row span { flex: 1; }
.hub-tpt-row a.btn { text-decoration: none; color: var(--ink); }
.hub-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.hub-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.hub-drawer-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }

@media (max-width: 800px) {
  .hub-table-wrap { max-height: none; }
  .hub-drawer { width: 100vw; }
  .hub-bools { grid-template-columns: 1fr; }
  .hub-toolbar input[type=search] { max-width: none; }
}

.hub-tpt-preview { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.hub-tq-row { font-size: 0.85rem; padding: 6px 8px; border-radius: 6px; background: #f6f8f6; }
.hub-tq-row.ok { background: #eef8f1; }
.hub-tq-row.dup { background: #fff8e6; }
.hub-tq-row.bad { background: #fdecea; }

/* Ticking several rows to change them at once */
.hub-table .hub-check-cell { width: 34px; text-align: center; padding-left: 8px; padding-right: 4px; cursor: default; }
.hub-check-cell input { width: 16px; height: 16px; accent-color: #43b36f; cursor: pointer; vertical-align: middle; }
.hub-table tbody tr.hub-ticked td { background: #eef8f1; }
.hub-bulk-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.16); padding: 10px 14px; max-width: calc(100vw - 32px); }
.hub-bulk-count { font-weight: 700; font-size: 0.88rem; margin-right: 4px; }

/* Colored quick-filter chips along the top */
.hub-chiprows { display: flex; flex-direction: column; gap: 6px; margin: -2px 0 12px; }
.hub-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.hub-chiprow-label { font-size: 0.72rem; color: var(--muted); width: 92px; flex-shrink: 0; }
.hub-fchip { border: 1px solid transparent; background: #f1f0ec; color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; cursor: pointer; white-space: nowrap; }
.hub-fchip span { opacity: 0.6; font-size: 0.72rem; margin-left: 2px; }
.hub-fchip:hover { filter: brightness(0.96); }
.hub-fchip.on { box-shadow: 0 0 0 2px var(--ring, #43b36f); font-weight: 700; }
.hub-fchip[data-chip-value=""].on { background: #43b36f; color: #fff; box-shadow: none; }
.hub-pill-click { cursor: pointer; }
.hub-pill-click:hover { filter: brightness(0.95); text-decoration: underline; }
@media (max-width: 800px) { .hub-chiprow-label { width: 100%; } }
.hub-filter select.on { border-color: #43b36f; background: #eef8f1; font-weight: 600; }
