/* Home-style.css — core design system: tokens, layout grid, header, cards, DECO shell.
 * Mobile-first. Desktop split layout starts at 1024px.
 */

/* ---------- tokens ---------- */
:root,
[data-theme="light"] {
  --c-green: #00a843; --c-green-d: #00913a; --c-green-t: rgba(0,168,67,.1);
  --c-bg: #f5f6f8; --c-surface: #fff; --c-text: #16181d; --c-muted: #6b7280;
  --c-faint: #98a0ac; --c-dim: #b6bcc6; --c-border: #e8eaee; --c-line: #dfe3e9;
  --c-soft: #f1f3f6; --c-hair: #ececf0; --c-tint: rgba(0,0,0,.02);
  --c-bar: rgba(0,0,0,.02); --c-util: #8c8c8c; --c-nav: rgba(255,255,255,.96);
  --c-ok-t: rgba(0,168,67,.1); --c-ok: #00812f; --c-over-t: rgba(214,69,58,.1); --c-over: #b4302a;
  --r-sm: 9px; --r-md: 13px; --r-lg: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
[data-theme="dark"] {
  --c-bg: #0f1115; --c-surface: #171a20; --c-text: #eef1f5; --c-muted: #9aa3b0;
  --c-faint: #7b8492; --c-dim: #5f6875; --c-border: #262b33; --c-line: #2f353f;
  --c-soft: #1e232a; --c-hair: #2c313a; --c-tint: rgba(255,255,255,.03);
  --c-bar: rgba(255,255,255,.03); --c-util: #6b7280; --c-nav: rgba(15,17,21,.96);
  --c-green-t: rgba(0,168,67,.18); --c-over-t: rgba(214,69,58,.16); --c-over: #ff8b83;
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--c-bg); color: var(--c-text);
  font-family: 'Times New Roman', Times, serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-green); text-decoration: none; }
a:hover { color: var(--c-green-d); }
:focus-visible { outline: 2px solid var(--c-green); outline-offset: 2px; }
::selection { background: var(--c-green-t); }
.scroll { scrollbar-width: none; -ms-overflow-style: none; }
.scroll::-webkit-scrollbar { display: none; }
.kicker { font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; color: var(--c-green); margin-bottom: 9px; }
.muted { color: var(--c-muted); }
[hidden] { display: none !important; }
.drawer-locked, .deco-locked { overflow: hidden; }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 20; background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.hdr-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.brand { flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--c-text); }
.brand:hover { color: var(--c-text); }
.brand-mark { width: 30px; height: 30px; flex: none; border-radius: var(--r-sm); background: var(--c-green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.3px; white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--c-line); border-radius: 11px; background: var(--c-surface); color: var(--c-text); transition: border-color .14s ease, color .14s ease, transform .09s ease; }
.icon-btn:hover { border-color: var(--c-green); color: var(--c-green); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 30px; height: 30px; border: 0; background: var(--c-soft); color: var(--c-muted); }
.icon-btn.xs { width: 28px; height: 28px; border: 0; background: var(--c-soft); color: var(--c-muted); }

/* ---------- generator ---------- */
.gen-row { display: flex; gap: 8px; padding: 0 14px 10px; }
.input-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 8px 0 13px; border: 1.5px solid var(--c-line); border-radius: var(--r-md); background: var(--c-bg); transition: border-color .14s ease; }
.input-wrap:focus-within { border-color: var(--c-green); }
.name-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; font-weight: 700; }
.name-len { font-size: 10px; font-weight: 800; color: var(--c-dim); font-variant-numeric: tabular-nums; }
.btn-green { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; width: 106px; height: 46px; border: 0; border-radius: var(--r-md); background: var(--c-green); color: #fff; font-size: 14px; font-weight: 800; transition: transform .09s ease, background-color .14s ease; will-change: transform; }
.btn-green:hover { background: var(--c-green-d); }
.btn-green:active { transform: scale(.96); }
.dice { display: inline-block; font-size: 13px; transition: transform .45s var(--ease); }
.preview-row { display: flex; align-items: baseline; gap: 10px; padding: 0 14px 9px; }
.preview-row .kicker { margin: 0; color: var(--c-faint); letter-spacing: 1.2px; flex: none; }
.preview { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; color: var(--c-green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- pill rail ---------- */
.rail { display: flex; gap: 7px; overflow-x: auto; padding: 0 14px 9px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.pill { flex: none; height: 32px; padding: 0 14px; border: 1.5px solid var(--c-line); border-radius: 999px; background: var(--c-surface); color: var(--c-muted); font-size: 12px; font-weight: 800; white-space: nowrap; scroll-snap-align: center; transition: transform .12s ease, box-shadow .18s ease, background-color .16s ease, border-color .16s ease; will-change: transform; }
.pill:hover { border-color: var(--c-green); color: var(--c-green); }
.pill:active { transform: scale(.95); }
.pill.is-active { background: var(--c-green); border-color: var(--c-green); color: #fff; box-shadow: 0 0 0 3px var(--c-green-t), 0 6px 16px rgba(0,168,67,.28); }

/* ---------- page body ---------- */
.page { padding: 10px 14px 96px; }
.stack { display: grid; gap: 14px; align-items: start; }
.side { display: none; }
.panel { background: var(--c-surface); border: 1px solid var(--c-hair); border-radius: 16px; padding: 14px; }

/* ---------- batches + cards ---------- */
.batch + .batch { margin-top: 14px; }
.batch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.batch-title { flex: 1; min-width: 0; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-meta { flex: none; font-size: 11px; font-weight: 700; color: var(--c-faint); font-variant-numeric: tabular-nums; }
.cgrid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }

@keyframes cardEntrance { from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.97); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }
.card { background: var(--c-surface); border: 1px solid var(--c-hair); border-radius: var(--r-lg); padding: 12px; }
.card.is-in { animation: cardEntrance .42s var(--ease) backwards; animation-delay: calc(var(--card-index, 0) * 45ms); will-change: transform, opacity; }
.card-out { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 62px; padding: 8px 6px 14px; font-size: 22px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Times New Roman', Times, serif, system-ui, sans-serif; }
.card-bar { display: flex; align-items: center; gap: 7px; }
.util { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 11px; border-radius: var(--r-md); background: var(--c-bar); overflow: hidden; }
.util-n { flex: none; font-size: 11.5px; font-weight: 600; color: var(--c-util); opacity: .8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.util-copy { flex: 1 1 auto; min-width: 44px; height: 42px; border: 0; background: none; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; color: var(--c-util); opacity: .85; transition: transform .09s ease, color .14s ease, opacity .14s ease; }
.util-copy:hover { color: var(--c-green); opacity: 1; }
.util-copy:active { transform: scale(.94); }
.util-tag { flex: 0 1 auto; min-width: 0; max-width: 96px; font-size: 11.5px; font-weight: 600; color: var(--c-util); opacity: .8; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav, .deco-btn { flex: none; width: 42px; height: 42px; border: 0; border-radius: var(--r-md); font-size: 15px; line-height: 1; transition: transform .09s ease, background-color .14s ease, color .14s ease; will-change: transform; }
.fav { background: var(--c-bar); color: var(--c-faint); }
.fav.is-on { background: var(--c-green-t); color: var(--c-green); }
.deco-btn { background: var(--c-green-t); color: var(--c-green); font-size: 16px; }
.deco-btn:hover { background: var(--c-green); color: #fff; }
.fav:active, .deco-btn:active { transform: scale(.92); }
.card-ad { display: grid; place-items: center; min-height: 128px; border-style: dashed; border-color: var(--c-line); background: var(--c-tint); }

/* ---------- load more ---------- */
.more { margin-top: 18px; width: 100%; height: 48px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1.5px solid var(--c-green); border-radius: 14px; background: var(--c-green-t); color: var(--c-green); font-size: 14px; font-weight: 800; transition: transform .09s ease, background-color .14s ease; will-change: transform; }
.more:active { transform: scale(.98); }
.more .spinner { display: none; width: 14px; height: 14px; border: 2px solid var(--c-green); border-top-color: transparent; border-radius: 50%; }
@keyframes spinLoop { to { transform: rotate(360deg); } }
.more.is-loading .spinner { display: block; animation: spinLoop .6s linear infinite; }
.empty { text-align: center; padding: 60px 20px; color: var(--c-faint); font-size: 13px; font-weight: 700; }

/* ---------- sidebar widgets ---------- */
.side-list { display: grid; gap: 1px; max-height: 300px; overflow-y: auto; }
.side-cat { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 9px; border: 0; border-radius: var(--r-sm); background: none; color: var(--c-muted); font-size: 13px; font-weight: 600; text-align: left; transition: background-color .14s ease, color .14s ease; }
.side-cat span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-cat:hover { background: var(--c-bar); }
.side-cat.is-active { background: var(--c-green-t); color: var(--c-green); }
.side-n { flex: none; font-size: 10.5px; font-weight: 700; color: var(--c-dim); font-variant-numeric: tabular-nums; }
.trend-list { display: grid; gap: 2px; }
.trend { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--c-text); text-align: left; transition: background-color .14s ease; }
.trend:hover { background: var(--c-bar); }
.trend-rank { flex: none; width: 16px; font-size: 10.5px; font-weight: 800; color: var(--c-dim); font-variant-numeric: tabular-nums; }
.trend-out { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-copy { flex: none; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--c-faint); }

/* ---------- SEO content ---------- */
.seo { margin-top: 18px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; padding: 16px; }
.seo h1, .seo h2 { font-size: 17px; font-weight: 800; letter-spacing: -.3px; line-height: 1.3; margin: 0 0 9px; text-wrap: pretty; }
.seo h3 { font-size: 14px; font-weight: 800; margin: 18px 0 6px; }
.seo p, .seo li { font-size: 13px; line-height: 1.65; color: var(--c-muted); text-wrap: pretty; }
.seo ul { padding-left: 18px; margin: 8px 0; }
.seo .cat-kicker { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--c-green); margin-bottom: 7px; }
.seo hr { border: 0; border-top: 1px solid var(--c-border); margin: 14px 0 12px; }

/* ---------- ads ---------- */
.ad { border: 1px dashed var(--c-line); border-radius: 14px; background: var(--c-tint); display: grid; place-items: center; text-align: center; padding: 12px; }
.ad-lead { height: 62px; margin-bottom: 12px; }
.ad-bottom { height: 92px; margin-top: 16px; }
.ad-sky { height: 300px; }

/* ---------- footer + bottom nav ---------- */
.foot { margin: 26px 14px 0; border-top: 1px solid var(--c-border); padding: 20px 0 12px; }
.foot-cols { display: grid; gap: 22px; }
.foot-brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; }
.foot-about { font-size: 13px; line-height: 1.65; color: var(--c-muted); margin: 11px 0 0; text-wrap: pretty; }
.foot-links { display: grid; gap: 2px; }
.foot-links a { padding: 8px 0; color: var(--c-muted); font-size: 14px; font-weight: 600; }
.foot-links a:hover { color: var(--c-green); }
.foot-note { border-top: 1px solid var(--c-border); margin-top: 20px; padding-top: 12px; text-align: center; font-size: 10px; font-weight: 700; color: var(--c-dim); }
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 74px; display: flex; align-items: center; padding: 0 8px 10px; background: var(--c-nav); backdrop-filter: blur(12px); border-top: 1px solid var(--c-border); }
.bnav a { flex: 1; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 14px; color: var(--c-faint); font-size: 10px; font-weight: 800; }
.bnav a.is-active { color: var(--c-green); }
.to-top { position: fixed; right: 14px; bottom: 88px; z-index: 25; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--c-green); color: #fff; box-shadow: 0 6px 18px rgba(0,168,67,.32); transition: transform .09s ease, background-color .14s ease; }
.to-top:hover { background: var(--c-green-d); }
.to-top:active { transform: scale(.94); }

/* ---------- drawer ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawerIn { from { transform: translate3d(-100%, 0, 0); } to { transform: translate3d(0, 0, 0); } }
.drawer-wrap { position: fixed; inset: 0; z-index: 60; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(8,11,15,.46); animation: fadeIn .18s ease-out; }
.drawer { position: absolute; left: 0; top: 0; bottom: 0; width: 296px; display: flex; flex-direction: column; background: var(--c-surface); animation: drawerIn .26s var(--ease); will-change: transform; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; border-bottom: 1px solid var(--c-border); }
.drawer-brand { flex: 1; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px 24px; }
.drawer-body a { display: flex; align-items: center; height: 40px; padding: 0 10px; border-radius: var(--r-sm); color: var(--c-muted); font-size: 14px; font-weight: 600; }
.drawer-body a:hover { background: var(--c-bar); color: var(--c-green); }
.drawer-body .kicker { margin: 18px 0 6px; color: var(--c-faint); }
.drawer-body .kicker:first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { height: 32px; padding: 0 13px; display: inline-flex; align-items: center; border: 1.5px solid var(--c-line); border-radius: 999px; color: var(--c-muted); font-size: 11px; font-weight: 800; }

/* ---------- toast ---------- */
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 70; max-width: 330px; padding: 11px 18px; border-radius: 12px; background: var(--c-text); color: var(--c-surface); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; }
.toast.is-on { opacity: 1; animation: toastIn .2s var(--ease); }

/* ---------- DECO shell ---------- */
@keyframes sheetUp { from { transform: translate3d(0, 100%, 0); } to { transform: translate3d(0, 0, 0); } }
@keyframes dialogIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes rowIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes badgeIn { from { opacity: 0; transform: translate3d(0, -4px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
.deco-wrap { position: fixed; inset: 0; z-index: 80; }
.deco-backdrop { position: absolute; inset: 0; background: rgba(8,11,15,.44); animation: fadeIn .18s ease-out; }
.deco-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; display: flex; flex-direction: column; overflow: hidden; background: var(--c-surface); border-radius: 22px 22px 0 0; animation: sheetUp .3s var(--ease); will-change: transform; }
.deco-grip { flex: none; display: grid; place-items: center; padding: 10px 0 0; }
.deco-grip::after { content: ''; width: 40px; height: 4px; border-radius: 4px; background: var(--c-line); }
.deco-head { flex: none; display: flex; align-items: center; gap: 9px; padding: 12px 18px; }
.deco-title { flex: none; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.deco-style { flex: 0 1 auto; min-width: 0; padding: 4px 9px; border-radius: 7px; background: var(--c-green-t); color: var(--c-green); font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deco-group { flex: 1 1 auto; min-width: 0; text-align: right; padding: 4px 9px; border-radius: 7px; background: var(--c-bar); color: var(--c-muted); font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: badgeIn .3s ease both; }
.deco-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--c-bar); color: var(--c-muted); font-size: 13px; font-weight: 700; transition: transform .09s ease, background-color .14s ease; }
.deco-x:active { transform: scale(.93); }
.deco-list { flex: 1; overflow-y: auto; display: grid; gap: 8px; padding: 2px 18px 14px; scrollbar-width: none; }
.deco-list::-webkit-scrollbar { display: none; }
.deco-row { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); animation: rowIn .38s var(--ease) backwards; will-change: transform, opacity; }
.deco-out { flex: 1; min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Times New Roman', Times, serif, system-ui, sans-serif; }
.deco-n { flex: none; padding: 3px 7px; border-radius: 7px; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.deco-n.ok { background: var(--c-ok-t); color: var(--c-ok); }
.deco-n.over { background: var(--c-over-t); color: var(--c-over); }
.deco-copy { flex: none; height: 32px; padding: 0 13px; border: 0; border-radius: 10px; background: var(--c-green); color: #fff; font-size: 11px; font-weight: 800; transition: transform .09s ease, background-color .14s ease; }
.deco-copy:hover { background: var(--c-green-d); }
.deco-copy:active { transform: scale(.94); }
.deco-foot { flex: none; border-top: 1px solid var(--c-border); padding: 12px 18px 16px; }
.deco-count { text-align: center; margin-bottom: 9px; font-size: 11px; font-weight: 700; color: var(--c-faint); font-variant-numeric: tabular-nums; }
.deco-more { width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-md); background: var(--c-green); color: #fff; font-size: 13.5px; font-weight: 800; transition: transform .09s ease, background-color .14s ease; will-change: transform; }
.deco-more:hover { background: var(--c-green-d); }
.deco-more:active { transform: scale(.97); }
.deco-more.is-done { background: var(--c-tint); border: 1px solid var(--c-hair); color: var(--c-dim); cursor: default; }
.deco-ico { display: inline-block; font-size: 13px; transition: transform .4s ease; }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  .hdr-row, .gen-row, .preview-row, .rail { max-width: 1440px; margin-left: auto; margin-right: auto; }
  .page { max-width: 1440px; margin: 0 auto; padding: 18px 22px 40px; }
  .stack { grid-template-columns: minmax(0, 1fr) 336px; gap: 22px; }
  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .side { display: grid; gap: 14px; position: sticky; top: 130px; }
  .bnav { display: none; }
  .to-top { right: 24px; bottom: 24px; }
  .foot { max-width: 1440px; margin: 26px auto 0; padding-left: 22px; padding-right: 22px; }
  .foot-cols { grid-template-columns: 1.6fr 1fr 1fr; gap: 34px; }
  .ad-lead { height: 90px; }
  .ad-sky { height: 600px; }
  .ad-bottom { height: 110px; }
  .deco-panel { left: 50%; right: auto; bottom: auto; top: 50%; width: 640px; max-width: calc(100vw - 64px); border-radius: var(--r-lg); transform: translate(-50%, -50%); animation: dialogIn .24s var(--ease); }
  .deco-backdrop { backdrop-filter: blur(7px); }
  .deco-grip { display: none; }
}
