/* ==========================================================================
   Harrasteblogi Core — Omat tallennukset (sydän, kirjanmerkki, kokoelmat)
   Käyttää teeman muuttujia (--red, --gold, --ink …), jos ne ovat olemassa;
   muuten alla olevat oletusarvot. Kaikki luokat alkavat etuliitteellä hbs-.
   ========================================================================== */

:where(.hbs-actions, .hbs-launcher, .hbs-float, .hbs-toast, .hbs-drawer, .hbs-overlay, .hbs-app, .hbs-page, .hbs-inline, .hbs-progress) {
  --hbs-red: var(--red, #d6111e);
  --hbs-red-dark: var(--red-dark, #a90d17);
  --hbs-red-tint: var(--red-tint, #fbe4e2);
  --hbs-gold: var(--gold, #ddc76d);
  --hbs-gold-deep: #b8962e;
  --hbs-gold-tint: var(--gold-tint, #f8f2df);
  --hbs-ink: var(--ink, #17110f);
  --hbs-ink-soft: var(--ink-soft, #4a413c);
  --hbs-muted: var(--muted, #7b716a);
  --hbs-line: var(--line, #e7ded3);
  --hbs-line-strong: var(--line-strong, #d3c7b6);
  --hbs-surface: var(--surface, #fff);
  --hbs-alt: var(--surface-alt, #f7f1e6);
  --hbs-shadow: 0 1px 2px rgba(23, 17, 15, .06), 0 14px 34px -18px rgba(23, 17, 15, .32);
  --hbs-ease: cubic-bezier(.22, 1, .36, 1);
  --hbs-spring: cubic-bezier(.34, 1.56, .64, 1);
}

html.hbs-lock { overflow: hidden; }
.hbs-app *, .hbs-drawer *, .hbs-float *, .hbs-toast *, .hbs-actions *, .hbs-launcher * { box-sizing: border-box; }
.hbs-app [hidden], .hbs-drawer [hidden] { display: none !important; }

/* ==========================================================================
   1. Sydän- ja kirjanmerkkipainikkeet
   ========================================================================== */
.hbs-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; vertical-align: middle; }
.hbs-btn {
  appearance: none; -webkit-appearance: none; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  margin: 0; padding: 0; border: 0; background: none; color: var(--hbs-ink); font: inherit; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .2s var(--hbs-ease), background-color .2s, border-color .2s, box-shadow .25s, color .2s;
}
.hbs-btn:focus-visible, .hbs-launcher:focus-visible, .hbs-x:focus-visible, .hbs-tab:focus-visible, .hbs-chip:focus-visible,
.hbs-mini-btn:focus-visible, .hbs-link-btn:focus-visible, .hbs-toast-btn:focus-visible, .hbs-btn-solid:focus-visible, .hbs-btn-ghost:focus-visible,
.hbs-more-btn:focus-visible, .hbs-col-card:focus-visible, .hbs-pop-item:focus-visible, .hbs-view-btn:focus-visible {
  outline: 3px solid var(--hbs-gold); outline-offset: 2px;
}
.hbs-ico { position: relative; display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; }
.hbs-ico svg { display: block; overflow: visible; transition: transform .3s var(--hbs-spring); }
.hbs-shape { fill: transparent; stroke: currentColor; stroke-width: 2; transition: fill .25s, stroke .25s; }

/* sydän: punainen täyttö */
.hbs-btn--fav.is-on { color: var(--hbs-red); }
.hbs-btn--fav.is-on .hbs-shape { fill: var(--hbs-red); stroke: var(--hbs-red); }
/* kirjanmerkki: kultainen täyttö */
.hbs-btn--later.is-on { color: var(--hbs-gold-deep); }
.hbs-btn--later.is-on .hbs-shape { fill: var(--hbs-gold); stroke: var(--hbs-gold-deep); }
.hbs-btn:active .hbs-ico svg { transform: scale(.82); }

/* "räjähdys": rengas + kuusi pistettä, käynnistyy luokalla .is-burst */
.hbs-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.hbs-burst::before, .hbs-burst::after { content: ""; position: absolute; left: 0; top: 0; border-radius: 50%; opacity: 0; }
.hbs-burst::before { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 2px solid currentColor; transform: scale(.3); }
.hbs-burst::after {
  width: 4px; height: 4px; margin: -2px 0 0 -2px; background: currentColor; transform: scale(.4);
  box-shadow: 0 -17px 0 currentColor, 15px -8px 0 currentColor, 15px 8px 0 currentColor, 0 17px 0 currentColor, -15px 8px 0 currentColor, -15px -8px 0 currentColor;
}
.hbs-btn.is-burst .hbs-ico svg { animation: hbs-pop .55s var(--hbs-spring); }
.hbs-btn.is-burst .hbs-burst::before { animation: hbs-ring .6s var(--hbs-ease); }
.hbs-btn.is-burst .hbs-burst::after { animation: hbs-dots .65s var(--hbs-ease); }
.hbs-btn--later.is-burst .hbs-ico svg { animation: hbs-drop .5s var(--hbs-spring); }
@keyframes hbs-pop { 0% { transform: scale(.7); } 45% { transform: scale(1.35) rotate(-6deg); } 100% { transform: scale(1); } }
@keyframes hbs-drop { 0% { transform: translateY(-6px) scale(.9); } 55% { transform: translateY(2px) scale(1.15); } 100% { transform: none; } }
@keyframes hbs-ring { 0% { opacity: .55; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes hbs-dots { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.25); } }

/* vanhat hakemistokorttien sydämet (.fav-btn) saavat saman "pop"-efektin */
.fav-btn.is-burst { animation: hbs-pop .55s var(--hbs-spring); }

/* ---- variantti: pill (artikkelisivu) ---- */
.hbs-actions--pill { gap: 10px; margin: 6px 0 2px; }
.hbs-actions--pill .hbs-btn {
  padding: 11px 18px 11px 14px; border-radius: 999px; background: var(--hbs-surface); border: 1.5px solid var(--hbs-line-strong);
  font-size: 14px; font-weight: 700; box-shadow: 0 1px 0 rgba(23, 17, 15, .04);
}
.hbs-actions--pill .hbs-btn:hover { transform: translateY(-2px); border-color: var(--hbs-ink); box-shadow: 0 10px 22px -14px rgba(23, 17, 15, .5); }
.hbs-actions--pill .hbs-btn--fav.is-on { background: linear-gradient(180deg, #fff 0%, var(--hbs-red-tint) 100%); border-color: var(--hbs-red); color: var(--hbs-red-dark); }
.hbs-actions--pill .hbs-btn--later.is-on { background: linear-gradient(180deg, #fff 0%, var(--hbs-gold-tint) 100%); border-color: var(--hbs-gold-deep); color: #6f5a17; }

/* ---- variantti: icon (kortit; lasimainen pyöreä painike kuvan päällä) ---- */
.hbs-actions--icon { gap: 6px; }
.hbs-actions--icon .hbs-btn {
  width: 38px; height: 38px; border-radius: 50%; color: var(--hbs-ink); background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .55), 0 0 0 1px rgba(23, 17, 15, .06);
}
.hbs-actions--icon .hbs-btn:hover { transform: scale(1.08); }
.hbs-actions--icon .hbs-btn.is-on { background: #fff; }
.hbs-actions--icon .hbs-lbl, .hbs-actions--mini .hbs-lbl, .hbs-float .hbs-lbl, .hbs-btn--fav.hbs-glyph .hbs-lbl {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.card > .hbs-actions--icon, .lg-card > .hbs-actions--icon, .dir-card-dark > .hbs-actions--icon { position: absolute; top: 10px; right: 10px; z-index: 4; }
.card, .lg-card { position: relative; }

/* ---- variantti: mini (tumma Juuri nyt -palkki) ---- */
.hbs-actions--mini { gap: 4px; margin-left: auto; }
.hbs-actions--mini .hbs-btn { width: 28px; height: 28px; border-radius: 50%; color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.hbs-actions--mini .hbs-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; transform: scale(1.1); }
.hbs-actions--mini .hbs-ico { width: 16px; height: 16px; }
.hbs-actions--mini .hbs-ico svg { width: 15px; height: 15px; }
.hbs-actions--mini .hbs-btn--fav.is-on { color: #ff4b5c; }
.hbs-actions--mini .hbs-btn--fav.is-on .hbs-shape { fill: #ff4b5c; stroke: #ff4b5c; }
.hbs-actions--mini .hbs-btn--later.is-on { color: var(--hbs-gold); }
.hbs-actions--mini .hbs-btn--later.is-on .hbs-shape { fill: var(--hbs-gold); stroke: var(--hbs-gold); }

/* ==========================================================================
   2. Yläpalkin painike + laskuri
   ========================================================================== */
.hbs-launcher {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer; color: var(--hbs-ink);
  background: var(--hbs-surface); border: 1.5px solid var(--hbs-line-strong);
  transition: transform .2s var(--hbs-ease), border-color .2s, box-shadow .2s, color .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.hbs-launcher svg { display: block; overflow: visible; }
.hbs-launcher .hbs-shape { fill: transparent; stroke: currentColor; stroke-width: 2; }
.hbs-launcher:hover { transform: translateY(-2px); border-color: var(--hbs-red); color: var(--hbs-red); box-shadow: 0 10px 22px -12px rgba(214, 17, 30, .55); }
.hbs-launcher.has-items { color: var(--hbs-red); border-color: rgba(214, 17, 30, .45); background: linear-gradient(180deg, #fff, var(--hbs-red-tint)); }
.hbs-launcher.has-items .hbs-shape { fill: var(--hbs-red); }
.hbs-launcher[aria-expanded="true"] { border-color: var(--hbs-red); box-shadow: 0 0 0 4px rgba(214, 17, 30, .14); }
.hbs-launcher-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--hbs-ink); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: 0; box-shadow: 0 0 0 2px var(--hbs-surface); font-variant-numeric: tabular-nums;
}
.hbs-launcher-count.is-bump { animation: hbs-bump .5s var(--hbs-spring); }
@keyframes hbs-bump { 0% { transform: scale(.6); } 55% { transform: scale(1.35); } 100% { transform: scale(1); } }
.hbs-launcher--float { position: fixed; right: 18px; bottom: 18px; z-index: 9000; width: 52px; height: 52px; box-shadow: var(--hbs-shadow); }

/* ==========================================================================
   3. Artikkelisivun kelluva palkki + lukuindikaattori
   ========================================================================== */
.hbs-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 10010; pointer-events: none; opacity: 0; transition: opacity .25s; }
.hbs-progress.is-on { opacity: 1; }
.hbs-progress span { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--hbs-red), #ff6a3d 60%, var(--hbs-gold)); box-shadow: 0 0 12px rgba(214, 17, 30, .5); }

.hbs-float {
  position: fixed; left: 50%; bottom: 22px; z-index: 9000; display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 999px;
  background: rgba(23, 17, 15, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .65), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .45s var(--hbs-ease), opacity .3s;
}
.hbs-float.is-in { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.hbs-float .hbs-btn { width: 44px; height: 44px; border-radius: 50%; color: #fff; }
.hbs-float .hbs-btn:hover { background: rgba(255, 255, 255, .12); transform: scale(1.06); }
.hbs-float .hbs-btn--fav.is-on { color: #ff4b5c; }
.hbs-float .hbs-btn--fav.is-on .hbs-shape { fill: #ff4b5c; stroke: #ff4b5c; }
.hbs-float .hbs-btn--later.is-on { color: var(--hbs-gold); }
.hbs-float .hbs-btn--later.is-on .hbs-shape { fill: var(--hbs-gold); stroke: var(--hbs-gold); }
.hbs-float-ring {
  width: 34px; height: 34px; margin: 0 4px 0 6px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--hbs-gold) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .16) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}
@media (max-width: 560px) { .hbs-float { bottom: 14px; } }

/* ==========================================================================
   4. Ilmoitus (toast)
   ========================================================================== */
.hbs-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 100030; max-width: calc(100vw - 28px); display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 18px;
  border-radius: 14px; background: var(--hbs-ink); color: #fff; font-size: 14px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 22px 50px -16px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transform: translate(-50%, 24px) scale(.96); opacity: 0; transition: transform .35s var(--hbs-spring), opacity .22s;
}
.hbs-toast.is-in { transform: translate(-50%, 0) scale(1); opacity: 1; }
.hbs-toast-msg { padding-right: 8px; }
.hbs-toast-btn {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer; padding: 9px 13px; border-radius: 9px; background: rgba(255, 255, 255, .1); color: var(--hbs-gold);
  font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .01em; transition: background .2s, color .2s;
}
.hbs-toast-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* ==========================================================================
   5. Sivupaneeli (drawer)
   ========================================================================== */
.hbs-overlay { position: fixed; inset: 0; z-index: 100010; background: rgba(23, 17, 15, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
.hbs-overlay.is-in { opacity: 1; }
.hbs-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100020; width: min(480px, 100vw); display: flex; flex-direction: column; background: var(--hbs-alt, #f7f1e6);
  box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .55); transform: translateX(104%); transition: transform .42s var(--hbs-ease); outline: none;
}
.hbs-drawer.is-in { transform: none; }
.hbs-drawer-head {
  position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 20px 20px 24px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #b60e19 0%, transparent 55%), linear-gradient(135deg, #17110f 0%, #2a0306 100%);
}
.hbs-drawer-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--hbs-red), var(--hbs-gold)); }
.hbs-drawer-title { margin: 0 0 3px; color: #fff; font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.hbs-drawer-sub { margin: 0; color: rgba(255, 255, 255, .72); font-size: 13px; }
.hbs-drawer-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.hbs-drawer-actions .hbs-link-btn { color: rgba(255, 255, 255, .85); }
.hbs-drawer-actions .hbs-link-btn:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.hbs-x { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .12); transition: background .2s, transform .2s var(--hbs-ease); }
.hbs-x:hover { background: rgba(255, 255, 255, .24); transform: rotate(90deg); }
.hbs-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 26px; scrollbar-width: thin; }
@media (max-width: 560px) { .hbs-drawer { width: 100vw; } .hbs-drawer-body { padding: 14px 12px 22px; } }

/* ==========================================================================
   6. Sovellus: tilastot, välilehdet, työkalut, suodattimet
   ========================================================================== */
.hbs-app { color: var(--hbs-ink); font-size: 15px; line-height: 1.5; }
.hbs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 22px; }
@media (max-width: 760px) { .hbs-stats { grid-template-columns: repeat(2, 1fr); } }
.hbs-stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--hbs-surface); border: 1px solid var(--hbs-line); box-shadow: var(--hbs-shadow); position: relative; overflow: hidden; }
.hbs-stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--hbs-line-strong); }
.hbs-stat--fav::before { background: var(--hbs-red); } .hbs-stat--later::before { background: var(--hbs-gold); } .hbs-stat--check::before { background: #2f9e6a; } .hbs-stat--folder::before { background: var(--hbs-ink); }
.hbs-stat-ic { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 12px; background: var(--hbs-alt); color: var(--hbs-ink); flex: none; }
.hbs-stat--fav .hbs-stat-ic { background: var(--hbs-red-tint); color: var(--hbs-red); }
.hbs-stat--later .hbs-stat-ic { background: var(--hbs-gold-tint); color: var(--hbs-gold-deep); }
.hbs-stat--check .hbs-stat-ic { background: #e3f4ec; color: #2f9e6a; }
.hbs-stat-tx { display: flex; flex-direction: column; min-width: 0; }
.hbs-stat-tx strong { font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hbs-stat-tx span { color: var(--hbs-muted); font-size: 12.5px; font-weight: 600; }

.hbs-tabs { display: flex; gap: 4px; padding: 5px; margin: 0 0 16px; border-radius: 16px; background: var(--hbs-surface); border: 1px solid var(--hbs-line); box-shadow: 0 1px 0 rgba(23, 17, 15, .03); overflow-x: auto; scrollbar-width: none; }
.hbs-tabs::-webkit-scrollbar { display: none; }
.hbs-tab {
  appearance: none; -webkit-appearance: none; flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 14px; border: 0; border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--hbs-ink-soft); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s;
}
.hbs-tab:hover { background: var(--hbs-alt); color: var(--hbs-ink); }
.hbs-tab.is-active { background: var(--hbs-ink); color: #fff; box-shadow: 0 8px 18px -10px rgba(23, 17, 15, .7); }
.hbs-tab.is-active .hbs-i--fav { color: #ff6b7a; } .hbs-tab.is-active .hbs-i--later { color: var(--hbs-gold); }
.hbs-app--drawer .hbs-tab { padding: 9px 8px; gap: 4px; font-size: 13.5px; }
.hbs-app--drawer .hbs-tab .hbs-i { display: none; }
.hbs-app--drawer .hbs-tab-n { min-width: 0; padding: 0 2px; background: none; font-size: 12px; opacity: .75; }
.hbs-app--drawer .hbs-tab.is-active .hbs-tab-n { background: none; opacity: 1; }
@media (max-width: 420px) { .hbs-app--drawer .hbs-tab { padding: 9px 8px; font-size: 13px; } .hbs-app--drawer .hbs-tab-n { display: none; } }
.hbs-tab-n { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--hbs-alt); color: var(--hbs-ink-soft); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hbs-tab.is-active .hbs-tab-n { background: rgba(255, 255, 255, .18); color: #fff; }

.hbs-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.hbs-search-wrap { flex: 1 1 200px; display: flex; align-items: center; gap: 9px; padding: 0 14px; height: 44px; border-radius: 12px; background: var(--hbs-surface); border: 1.5px solid var(--hbs-line); color: var(--hbs-muted); transition: border-color .2s, box-shadow .2s; }
.hbs-search-wrap:focus-within { border-color: var(--hbs-red); box-shadow: 0 0 0 4px rgba(214, 17, 30, .12); color: var(--hbs-red); }
.hbs-search { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--hbs-ink); font: inherit; font-size: 14.5px; -webkit-appearance: none; appearance: none; }
.hbs-select { height: 44px; padding: 0 34px 0 14px; border-radius: 12px; border: 1.5px solid var(--hbs-line); background: var(--hbs-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2317110f' stroke-width='2' stroke-linecap='round' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 13px center; color: var(--hbs-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; -webkit-appearance: none; appearance: none; }
.hbs-select:focus-visible { outline: 3px solid var(--hbs-gold); outline-offset: 2px; }
.hbs-view { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--hbs-surface); border: 1.5px solid var(--hbs-line); }
.hbs-view-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 34px; border: 0; border-radius: 8px; cursor: pointer; background: transparent; color: var(--hbs-muted); transition: background .2s, color .2s; }
.hbs-view-btn.is-active { background: var(--hbs-ink); color: #fff; }

.hbs-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.hbs-chip { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; cursor: pointer; background: var(--hbs-surface); border: 1.5px solid var(--hbs-line); color: var(--hbs-ink-soft); font: inherit; font-size: 13px; font-weight: 700; transition: all .2s; }
.hbs-chip em { font-style: normal; font-size: 11.5px; padding: 1px 6px; border-radius: 999px; background: var(--hbs-alt); color: var(--hbs-muted); font-variant-numeric: tabular-nums; }
.hbs-chip:hover { border-color: var(--hbs-ink); color: var(--hbs-ink); }
.hbs-chip.is-active { background: var(--hbs-red); border-color: var(--hbs-red); color: #fff; box-shadow: 0 8px 18px -10px rgba(214, 17, 30, .8); }
.hbs-chip.is-active em { background: rgba(255, 255, 255, .22); color: #fff; }

.hbs-colbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--hbs-surface); border: 1px solid var(--hbs-line); }
.hbs-colbar-t { margin: 0; flex: 1; min-width: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   7. Painike-apuluokat (linkit, täytetyt, haamu, pienet ikonipainikkeet)
   ========================================================================== */
.hbs-link-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 10px; cursor: pointer; background: transparent; color: var(--hbs-ink-soft); font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; transition: background .2s, color .2s; }
.hbs-link-btn:hover, .hbs-link-btn.is-active { background: var(--hbs-alt); color: var(--hbs-ink); text-decoration: none; }
.hbs-link-btn--danger:hover, .hbs-link-btn--danger.is-active { background: var(--hbs-red-tint); color: var(--hbs-red-dark); }
.hbs-btn-solid { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 11px 18px; border: 0; border-radius: 12px; cursor: pointer; background: var(--hbs-ink); color: #fff; font: inherit; font-size: 14px; font-weight: 700; transition: background .2s, transform .2s var(--hbs-ease); }
.hbs-btn-solid:hover { background: var(--hbs-red); transform: translateY(-1px); }
.hbs-btn-solid--danger { background: var(--hbs-red); } .hbs-btn-solid--danger:hover { background: var(--hbs-red-dark); }
.hbs-btn-ghost { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 10px 17px; border-radius: 12px; cursor: pointer; background: transparent; color: var(--hbs-ink); border: 1.5px solid var(--hbs-line-strong); font: inherit; font-size: 14px; font-weight: 700; transition: border-color .2s, background .2s; }
.hbs-btn-ghost:hover { border-color: var(--hbs-ink); background: var(--hbs-surface); }
.hbs-mini-btn { appearance: none; -webkit-appearance: none; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--hbs-line); border-radius: 10px; cursor: pointer; background: var(--hbs-surface); color: var(--hbs-ink-soft); font: inherit; font-size: 12px; font-weight: 800; transition: transform .2s var(--hbs-ease), background .2s, color .2s, border-color .2s; }
.hbs-mini-btn:hover { transform: translateY(-2px); border-color: var(--hbs-ink); color: var(--hbs-ink); }
.hbs-mini-btn--fav.is-on { color: var(--hbs-red); border-color: rgba(214, 17, 30, .4); background: var(--hbs-red-tint); }
.hbs-mini-btn--later.is-on { color: #6f5a17; border-color: var(--hbs-gold-deep); background: var(--hbs-gold-tint); }
.hbs-mini-btn--done.is-on { color: #1f7a4f; border-color: rgba(47, 158, 106, .5); background: #e3f4ec; }
.hbs-mini-btn--col.is-on { color: var(--hbs-ink); border-color: var(--hbs-ink); }
.hbs-mini-btn--danger:hover { color: var(--hbs-red-dark); border-color: var(--hbs-red); background: var(--hbs-red-tint); }
.hbs-mini-btn--danger.is-armed { color: #fff; background: var(--hbs-red); border-color: var(--hbs-red); }
.hbs-input { flex: 1; min-width: 0; height: 42px; padding: 0 13px; border-radius: 11px; border: 1.5px solid var(--hbs-line-strong); background: var(--hbs-surface); color: var(--hbs-ink); font: inherit; font-size: 14px; }
.hbs-input:focus { outline: 0; border-color: var(--hbs-red); box-shadow: 0 0 0 4px rgba(214, 17, 30, .12); }
.hbs-inline-form { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; }

/* ==========================================================================
   8. Lista, kortit, kokoelmat
   ========================================================================== */
.hbs-list { display: grid; gap: 14px; }
.hbs-list--grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.hbs-app--drawer .hbs-list--grid { grid-template-columns: 1fr; }
.hbs-app--inline .hbs-list--grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.hbs-list--empty, .hbs-list--cols { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.hbs-list-full { grid-column: 1 / -1; }

.hbs-card {
  position: relative; display: flex; flex-direction: column; border-radius: 18px; background: var(--hbs-surface); border: 1px solid var(--hbs-line); box-shadow: var(--hbs-shadow);
  transition: transform .3s var(--hbs-ease), box-shadow .3s; animation: hbs-in .45s var(--hbs-ease) both;
}
.hbs-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(23, 17, 15, .06), 0 24px 44px -22px rgba(23, 17, 15, .42); }
@keyframes hbs-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hbs-card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 17px 17px 0 0; background: linear-gradient(135deg, #2a0306, #17110f); }
.hbs-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--hbs-ease); }
.hbs-card:hover .hbs-card-media img { transform: scale(1.05); }
.hbs-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; background: linear-gradient(135deg, #7a0a13, #17110f); }
.hbs-ph::before, .hbs-ph::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); pointer-events: none; }
.hbs-ph::before { width: 70%; aspect-ratio: 1; left: -14%; top: -38%; }
.hbs-ph::after { width: 54%; aspect-ratio: 1; right: -12%; bottom: -34%; background: rgba(255, 255, 255, .07); }
.hbs-ph-ic { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 2.1em; height: 2.1em; font-size: 1em; padding: .35em; border-radius: 50%; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 10px 24px -12px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.hbs-ph-ic svg { display: block; width: 100%; height: 100%; }
.hbs-ph--domain { background: linear-gradient(135deg, #0f6aa6, #0a2740); }
.hbs-ph--kaupunki { background: linear-gradient(135deg, #2f9e6a, #0d3b2a); }
.hbs-ph--nettiraidiot { background: linear-gradient(135deg, #8e24aa, #2a0c3a); }
.hbs-ph--ilmaiskokeilu { background: linear-gradient(135deg, #c9a52e, #5b4310); }
.hbs-ph--hb_error_code { background: linear-gradient(135deg, #d6111e, #3a0508); }
.hbs-ph--post { background: linear-gradient(135deg, #a90d17, #17110f); }
.hbs-card-media .hbs-ph { font-size: 22px; }
.hbs-mosaic .hbs-ph { position: relative; inset: auto; font-size: 13px; }
.hbs-mosaic .hbs-ph-ic { width: 2em; height: 2em; padding: .3em; }
.hbs-col-card .hbs-mosaic .hbs-ph::before, .hbs-col-card .hbs-mosaic .hbs-ph::after { display: none; }
.hbs-type { position: absolute; left: 12px; top: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(23, 17, 15, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.hbs-done-badge { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: #2f9e6a; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.hbs-card-body { display: flex; flex-direction: column; gap: 8px; padding: 15px 16px 16px; flex: 1; position: relative; }
.hbs-card-t { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.28; letter-spacing: -.01em; }
.hbs-card-t a { color: var(--hbs-ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .35s var(--hbs-ease), color .2s; }
.hbs-card-t a:hover { color: var(--hbs-red-dark); background-size: 100% 2px; }
.hbs-ex { margin: 0; color: var(--hbs-muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hbs-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; padding-top: 4px; color: var(--hbs-muted); font-size: 12px; font-weight: 600; }
.hbs-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: var(--hbs-alt); color: var(--hbs-ink-soft); }
.hbs-card-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--hbs-line); }
.hbs-card-acts .hbs-mini-btn--danger { margin-left: auto; }
.hbs-card.is-done .hbs-card-t a { color: var(--hbs-muted); }
.hbs-card.is-done .hbs-card-media img { filter: grayscale(.7) opacity(.75); }
.hbs-card.is-gone { background: repeating-linear-gradient(135deg, #fff, #fff 10px, #faf6ef 10px, #faf6ef 20px); }
.hbs-gone-note { margin: 0; color: var(--hbs-red-dark); font-size: 13px; font-weight: 600; }

/* lista-näkymä ja paneelin kortit: vaakasuuntainen */
.hbs-list--list .hbs-card, .hbs-app--drawer .hbs-card { flex-direction: row; align-items: stretch; }
.hbs-list--list .hbs-card-media, .hbs-app--drawer .hbs-card-media { flex: none; width: 128px; aspect-ratio: auto; border-radius: 17px 0 0 17px; }
.hbs-app--drawer .hbs-card-media { width: 104px; }
.hbs-list--list .hbs-card-body, .hbs-app--drawer .hbs-card-body { padding: 13px 14px; min-width: 0; }
.hbs-app--drawer .hbs-card-t, .hbs-list--list .hbs-card-t { font-size: 15.5px; }
.hbs-app--drawer .hbs-ex { -webkit-line-clamp: 2; }
.hbs-list--list .hbs-type, .hbs-app--drawer .hbs-type { left: 8px; top: 8px; padding: 3px 8px; font-size: 10px; }
.hbs-list--list .hbs-done-badge, .hbs-app--drawer .hbs-done-badge { right: auto; left: 8px; top: auto; bottom: 8px; padding: 3px 8px; font-size: 10px; }
@media (max-width: 520px) { .hbs-list--list .hbs-card-media { width: 96px; } }

/* kokoelmakortit */
.hbs-col-card { appearance: none; -webkit-appearance: none; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; text-align: left; cursor: pointer; border-radius: 18px; background: var(--hbs-surface); border: 1px solid var(--hbs-line); box-shadow: var(--hbs-shadow); font: inherit; color: var(--hbs-ink); transition: transform .3s var(--hbs-ease), box-shadow .3s; animation: hbs-in .45s var(--hbs-ease) both; }
.hbs-col-card:hover { transform: translateY(-3px); box-shadow: 0 24px 44px -22px rgba(23, 17, 15, .42); }
.hbs-mosaic { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--hbs-alt); }
.hbs-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hbs-mosaic > :first-child { grid-row: 1 / 3; }
.hbs-mosaic.is-n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.hbs-mosaic.is-n2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.hbs-mosaic.is-n2 > :first-child { grid-row: auto; }
.hbs-mosaic.is-empty { display: flex; align-items: center; justify-content: center; color: var(--hbs-line-strong); background: linear-gradient(135deg, var(--hbs-alt), #fff); }
.hbs-col-name { font-size: 16px; font-weight: 800; letter-spacing: -.01em; padding: 0 2px; }
.hbs-col-count { font-size: 12.5px; color: var(--hbs-muted); font-weight: 600; padding: 0 2px; }
.hbs-newcol { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px; border-radius: 16px; border: 2px dashed var(--hbs-line-strong); background: rgba(255, 255, 255, .6); }
.hbs-newcol .hbs-input { flex: 1 1 200px; }

/* kokoelmavalikko (popover) */
.hbs-pop { position: absolute; z-index: 20; left: 12px; right: 12px; bottom: 58px; padding: 12px; border-radius: 16px; background: var(--hbs-surface); border: 1px solid var(--hbs-line-strong); box-shadow: 0 30px 60px -20px rgba(23, 17, 15, .55); animation: hbs-in .25s var(--hbs-ease) both; }
.hbs-pop-t { margin: 0 0 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--hbs-muted); }
.hbs-pop-list { display: flex; flex-direction: column; gap: 2px; max-height: 176px; overflow-y: auto; margin-bottom: 10px; }
.hbs-pop-empty { margin: 0; padding: 4px 2px 8px; color: var(--hbs-muted); font-size: 13px; }
.hbs-pop-item { appearance: none; -webkit-appearance: none; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: 0; border-radius: 10px; cursor: pointer; background: transparent; color: var(--hbs-ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; transition: background .15s; }
.hbs-pop-item:hover { background: var(--hbs-alt); }
.hbs-check { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--hbs-line-strong); color: #fff; flex: none; transition: all .2s; }
.hbs-pop-item.is-on .hbs-check { background: var(--hbs-red); border-color: var(--hbs-red); }
.hbs-pop .hbs-inline-form .hbs-input { height: 38px; font-size: 13.5px; }
.hbs-pop .hbs-btn-solid { padding: 9px 14px; font-size: 13px; }

/* tyhjä tila */
.hbs-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 44px 22px 40px; border-radius: 22px; border: 2px dashed var(--hbs-line-strong); background: radial-gradient(90% 120% at 50% 0%, #fff 0%, rgba(255, 255, 255, .35) 100%); }
.hbs-empty-art { display: inline-flex; align-items: center; justify-content: center; width: 78px; height: 78px; margin-bottom: 10px; border-radius: 50%; color: var(--hbs-red); background: radial-gradient(circle at 30% 25%, #fff, var(--hbs-red-tint)); box-shadow: 0 16px 30px -16px rgba(214, 17, 30, .55), inset 0 0 0 1px rgba(214, 17, 30, .16); animation: hbs-float 3.6s ease-in-out infinite; }
@keyframes hbs-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hbs-empty-h { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--hbs-ink); }
.hbs-empty-p { margin: 0 0 8px; max-width: 42ch; color: var(--hbs-muted); font-size: 14.5px; }
.hbs-cta { display: inline-flex; align-items: center; padding: 11px 22px; border-radius: 999px; background: var(--hbs-red); color: #fff; font-size: 14px; font-weight: 800; text-decoration: none; transition: background .2s, transform .2s var(--hbs-ease); }
.hbs-cta:hover { background: var(--hbs-red-dark); color: #fff; transform: translateY(-2px); text-decoration: none; }

.hbs-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; }
.hbs-more-btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; gap: 9px; padding: 12px 24px; border-radius: 999px; cursor: pointer; border: 1.5px solid var(--hbs-line-strong); background: var(--hbs-surface); color: var(--hbs-ink); font: inherit; font-size: 14px; font-weight: 700; transition: all .2s; }
.hbs-more-btn:hover { border-color: var(--hbs-red); color: var(--hbs-red-dark); transform: translateY(-2px); }
.hbs-inline-all { font-size: 13.5px; font-weight: 800; color: var(--hbs-red-dark); text-decoration: none; }
.hbs-inline-all:hover { text-decoration: underline; }

/* ==========================================================================
   9. Alatunniste (tyhjennys)
   ========================================================================== */
.hbs-panel { margin: 22px 0 6px; padding: 18px 20px; border-radius: 18px; background: var(--hbs-surface); border: 1px solid var(--hbs-line); box-shadow: var(--hbs-shadow); animation: hbs-in .3s var(--hbs-ease) both; }
.hbs-panel-p { margin: 0 0 12px; color: var(--hbs-muted); font-size: 13.5px; }
.hbs-panel-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hbs-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--hbs-line); }
.hbs-foot-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.hbs-note { margin: 0; color: var(--hbs-muted); font-size: 12.5px; }

/* ==========================================================================
   10. Artikkelisivun tabit ("Omat tallennukset") ja Omat tallennukset -sivu
   ========================================================================== */
.hbs-inline {
  margin: 34px 0 10px; padding: 22px 22px 20px; border-radius: 22px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, var(--hbs-alt) 100%); border: 1px solid var(--hbs-line); box-shadow: var(--hbs-shadow);
}
.hbs-inline::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--hbs-red), var(--hbs-gold)); }
.hbs-inline-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.hbs-inline-head-ic { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--hbs-red), #8d0a13); box-shadow: 0 10px 20px -12px rgba(214, 17, 30, .9); }
.hbs-inline-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.hbs-inline-head p { margin: 0; color: var(--hbs-muted); font-size: 13px; }
.hbs-inline .hbs-tabs { background: rgba(255, 255, 255, .7); }
@media (max-width: 560px) { .hbs-inline { padding: 18px 14px 16px; border-radius: 18px; } }

.hbs-page { margin: 8px 0 30px; }
.hbs-page-loading { color: var(--hbs-muted); }

/* ==========================================================================
   11. Liikkeen vähentäminen, pakotetut värit, tulostus
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hbs-btn, .hbs-btn .hbs-ico svg, .hbs-launcher, .hbs-float, .hbs-toast, .hbs-drawer, .hbs-overlay, .hbs-card, .hbs-col-card, .hbs-mini-btn, .hbs-panel, .hbs-pop { transition: none !important; animation: none !important; }
  .hbs-btn.is-burst .hbs-burst::before, .hbs-btn.is-burst .hbs-burst::after, .hbs-empty-art, .hbs-launcher-count.is-bump { animation: none !important; }
}
@media (forced-colors: active) {
  .hbs-btn--fav.is-on .hbs-shape, .hbs-launcher.has-items .hbs-shape { fill: CanvasText; }
  .hbs-tab.is-active, .hbs-chip.is-active { outline: 2px solid Highlight; }
}
@media print { .hbs-launcher, .hbs-float, .hbs-progress, .hbs-toast, .hbs-drawer, .hbs-overlay, .hbs-actions, .hbs-inline { display: none !important; } }

/* ---- teeman yläpalkin sijoittelu ja artikkelisivun painikerivi ---- */
.site-header .hbs-launcher { margin-left: auto; margin-right: 10px; flex: none; }
.site-header .nav-toggle { order: 3; }
@media (max-width: 900px) { .site-header .hbs-launcher { margin-right: 8px; } }
.hbs-article-actions { margin-top: 18px; }
