/* Shared styles for /login and /app (Tailwind CDN handles the utility classes). */
:root { color-scheme: dark; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background: #070708; color: #fff;
}
.pixel { font-family: 'Silkscreen', cursive; font-weight: 400; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* glass */
.glass-d {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.glass-d-strong {
  background: rgba(14,14,16,.72);
  border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
}

/* form fields */
.field {
  width: 100%; border-radius: 14px; padding: .72rem .95rem;
  font-size: .9rem; line-height: 1.35; color: #fff; outline: none;
  background: rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.1);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field::placeholder { color: rgba(255,255,255,.3); }
.field:hover { border-color: rgba(255,255,255,.18); }
.field:focus { border-color: rgba(255,255,255,.4); box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.field[aria-invalid="true"] { border-color: rgba(248,113,113,.7); }
.field.otp { padding-left: calc(.95rem + .6em); text-align: center; font-family: 'Silkscreen', cursive; font-size: clamp(1.25rem, 6.5vw, 1.6rem); letter-spacing: .6em; } /* the 6-digit code: padding-left offsets the spacing after the last digit, so it looks centred */
.field.otp::placeholder { letter-spacing: .6em; }
input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .55; cursor: pointer; }
label.lbl { display: block; margin-bottom: .45rem; font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.42); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 9999px;
  font-size: .875rem; font-weight: 600; padding: .72rem 1.4rem; cursor: pointer; border: 0;
  transition: opacity .2s, transform .15s, background-color .2s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-white { background: #fff; color: #010101; }
.btn-white:hover:not(:disabled) { opacity: .9; }
.btn-ghost { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.08); font-weight: 500; }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.14); color: #fff; }
.btn-danger { background: rgba(239,68,68,.18); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); font-weight: 500; }
.btn-sm { padding: .42rem .85rem; font-size: .78rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 9999px;
  color: rgba(255,255,255,.55); background: transparent; border: 0; cursor: pointer; transition: background-color .2s, color .2s; }
.icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* segmented tabs (connect dialog, posts list): the label colour follows aria-selected, so it never depends on JS-set inline styles */
[role="tablist"] > [role="tab"] { color: rgba(255,255,255,.65); }
[role="tablist"] > [role="tab"][aria-selected="true"] { color: #010101; }

/* channel / schedule chips */
.chip { display: inline-flex; align-items: center; gap: .5rem; border-radius: 9999px; padding: .5rem .9rem;
  font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.8); cursor: pointer;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  transition: background-color .2s, color .2s, transform .15s, border-color .2s; }
.chip:hover { background: rgba(255,255,255,.13); color: #fff; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: #fff; color: #010101; border-color: #fff; }

/* hashtag chips (suggestions under the composer, top hashtags in Insights) */
.tag-chip { gap: .4rem; padding: .28rem .75rem; font-size: .78rem; }
.tag-chip small { font-size: .68rem; color: rgba(255,255,255,.4); }
.tag-chip.is-active { background: #fff; color: #010101; border-color: #fff; }
.tag-chip.is-active small { color: rgba(0,0,0,.45); }
kbd.key { padding: .05rem .35rem; border-radius: 6px; font-family: inherit; font-size: .65rem; color: rgba(255,255,255,.6); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }

/* week strip above the time chips: the next 7 days, a dot per scheduled post */
.day-tile { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem 0 .4rem; border-radius: 14px; cursor: pointer; color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); transition: background-color .2s, color .2s, transform .15s, border-color .2s; }
.day-tile:hover { background: rgba(255,255,255,.12); color: #fff; }
.day-tile:active { transform: scale(.96); }
.day-tile[aria-pressed="true"] { background: #fff; color: #010101; border-color: #fff; }
.day-wd { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; opacity: .55; }
.day-num { font-size: 1.05rem; line-height: 1.1; }
.day-dots { display: flex; gap: 2px; height: 5px; }
.day-dots i { width: 4px; height: 4px; border-radius: 9999px; background: #7dd3fc; }
.day-tile[aria-pressed="true"] .day-dots i { background: #0ea5e9; }

/* emoji picker */
.emoji-cell { display: flex; align-items: center; justify-content: center; height: 2.1rem; border-radius: 10px; font-size: 1.2rem; line-height: 1; background: transparent; border: 0; cursor: pointer; transition: background-color .15s, transform .12s; }
.emoji-cell:hover { background: rgba(255,255,255,.12); }
.emoji-cell:active { transform: scale(.88); }

/* networks: icon tile, group heading, picker card (tile colours come from NET in dashboard.js) */
.net-tile { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; }
.net-group-label { display: flex; align-items: center; gap: .45rem; margin-bottom: .6rem; font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.42); }
.net-group-label > .net-count { margin-left: .1rem; color: rgba(255,255,255,.25); }
.net-card { display: flex; width: 100%; align-items: center; gap: .85rem; padding: .85rem 1rem; border-radius: 18px; text-align: left; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  transition: background-color .2s, border-color .2s, transform .15s; }
.net-card:hover:not(:disabled) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.net-card:active:not(:disabled) { transform: scale(.985); }
.net-card:disabled { opacity: .5; cursor: not-allowed; }
.net-card:focus-visible { outline: 2px solid rgba(255,255,255,.55); outline-offset: 2px; }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; border-radius: 9999px; padding: .18rem .6rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .02em; border: 1px solid transparent; }
.badge::before { content: ''; width: .35rem; height: .35rem; border-radius: 9999px; background: currentColor; }
.badge-scheduled  { color: #7dd3fc; background: rgba(56,189,248,.12);  border-color: rgba(56,189,248,.25); }
.badge-processing { color: #fcd34d; background: rgba(251,191,36,.12);  border-color: rgba(251,191,36,.25); }
.badge-sent       { color: #6ee7b7; background: rgba(52,211,153,.12);  border-color: rgba(52,211,153,.25); }
.badge-failed     { color: #fca5a5; background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.28); }
.badge-cancelled  { color: rgba(255,255,255,.5); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }

/* motion */
.spinner { width: 1rem; height: 1rem; border-radius: 9999px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; }
.spinner-dark { border-color: rgba(0,0,0,.2); border-top-color: #010101; }
@keyframes spin { to { transform: rotate(360deg); } }
.shake { animation: shake .35s ease-in-out; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.pop { animation: pop .4s cubic-bezier(.16,1,.3,1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeup .6s cubic-bezier(.16,1,.3,1) both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pop, .fade-up, .shake { animation: none; } .spinner { animation-duration: 2s; } }

/* skeleton */
.skeleton { border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* toasts */
#toasts { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .6rem; max-width: min(22rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .7rem; padding: .8rem 1rem; border-radius: 16px; font-size: .85rem; line-height: 1.4;
  background: rgba(18,18,22,.92); border: 1px solid rgba(255,255,255,.1); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.7); animation: pop .35s cubic-bezier(.16,1,.3,1); }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.toast-ok .toast-ico { color: #34d399; } .toast-err .toast-ico { color: #f87171; } .toast-info .toast-ico { color: #7dd3fc; }

/* modal */
dialog.vane-dialog { padding: 0; border: 0; background: transparent; color: #fff; max-width: min(34rem, calc(100vw - 1.5rem)); width: 100%; max-height: calc(100vh - 2rem); overflow: visible; margin: auto; }
dialog.vane-dialog::backdrop { background: rgba(0,0,0,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog.vane-dialog { opacity: 0; transform: translateY(10px) scale(.97);
  transition: opacity .22s ease, transform .3s var(--ease-out), overlay .3s allow-discrete, display .3s allow-discrete; }
dialog.vane-dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog.vane-dialog[open] { opacity: 0; transform: translateY(10px) scale(.97); } }
dialog.vane-dialog::backdrop { transition: opacity .25s ease, overlay .25s allow-discrete, display .25s allow-discrete; opacity: 0; }
dialog.vane-dialog[open]::backdrop { opacity: 1; }
@starting-style { dialog.vane-dialog[open]::backdrop { opacity: 0; } }

/* media picker */
.dropzone { display: flex; width: 100%; flex-direction: column; align-items: center; gap: .5rem; padding: 1.4rem 1rem;
  border-radius: 18px; border: 1.5px dashed rgba(255,255,255,.16); background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.82); text-align: center; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .15s; }
.dropzone:hover:not(:disabled), .dropzone.is-over { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); }
.dropzone.is-over { transform: scale(1.012); }
.dropzone:disabled { opacity: .55; cursor: not-allowed; }
.dropzone:focus-visible { outline: 2px solid rgba(255,255,255,.55); outline-offset: 2px; }
.progress { height: .375rem; overflow: hidden; border-radius: 9999px; background: rgba(255,255,255,.1); }
.progress > span { display: block; height: 100%; width: 0; border-radius: 9999px; background: #fff; transition: width .18s ease-out; }
.progress.is-indeterminate > span { width: 40% !important; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ── API access screen ── */
.meter { height: .5rem; border-radius: 9999px; background: rgba(255,255,255,.1); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 9999px; transition: width .7s cubic-bezier(.16,1,.3,1), background-color .3s; }
.mode-btn { display: block; width: 100%; padding: .85rem 1rem; border-radius: 16px; text-align: left; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); transition: background-color .2s, border-color .2s; }
.mode-btn:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.mode-btn[aria-pressed="true"] { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.45); }
.mode-btn:disabled { opacity: .4; cursor: not-allowed; }
.mode-btn:focus-visible { outline: 2px solid rgba(255,255,255,.55); outline-offset: 2px; }
details > summary.api-sum { list-style: none; cursor: pointer; }
details > summary.api-sum::-webkit-details-marker { display: none; }
details[open] .api-plus { transform: rotate(45deg); }

/* Hand-off card under the greeting: Vane Post <-> Vane Studio (markup in app.html / studio.html, wired by vane.js) */
.handoff { position: relative; display: flex; align-items: center; gap: 1rem; overflow: hidden; color: inherit; text-decoration: none;
  transition: border-color .25s, transform .25s cubic-bezier(.16,1,.3,1); }
.handoff::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .7; transition: opacity .3s;
  background: radial-gradient(60% 150% at 0% 50%, var(--ho-glow, rgba(99,102,241,.2)), transparent 70%); }
.handoff > * { position: relative; }
.handoff:hover { border-color: rgba(255,255,255,.22); transform: translateY(-1px); }
.handoff:hover::before { opacity: 1; }
.handoff:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
.handoff-ico { flex: none; display: flex; width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; border-radius: 14px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.handoff-ico svg { width: 1.25rem; height: 1.25rem; }
.handoff-body { min-width: 0; }
.handoff-body > span { display: block; }
.handoff-title { margin-top: .3rem; font-size: 1rem; font-weight: 600; }
.handoff-text { margin-top: .25rem; max-width: 38rem; font-size: .8rem; line-height: 1.5; color: rgba(255,255,255,.55); }
.handoff-cta { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.handoff-cta svg { width: 1rem; height: 1rem; transition: transform .25s cubic-bezier(.16,1,.3,1); }
.handoff:hover .handoff-cta svg { transform: translateX(4px); }
/* phone: icon + text on the first row, the link under the text (a flex row squeezed the text into a thin column) */
@media (max-width: 639px) {
  .handoff { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: .9rem; row-gap: .85rem; }
  .handoff-cta { grid-column: 2; margin-left: 0; }
}

/* leaving a dashboard through a hand-off link (see wireHandoff in vane.js) */
html.is-leaving #app { opacity: 0 !important; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease; }

/* Dashboard tabs (Create / Library) and the small pieces of the Library tab. Views marked data-view are shown one at a time by library.js;
   the attribute rule is needed because a Tailwind display class (grid, flex) would otherwise beat the plain [hidden]. */
[data-view][hidden] { display: none !important; }
.dtab { display: inline-flex; align-items: center; border-radius: 9999px; padding: .5rem 1rem; font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.6);
  border: 1px solid transparent; transition: background-color .2s, color .2s; }
.dtab:hover { background: rgba(255,255,255,.07); color: #fff; }
.dtab[aria-current="page"] { background: #fff; color: #000; }
.dtab:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; border-radius: 9999px; padding: .4rem .85rem; font-size: .8rem; font-weight: 500; color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); transition: background-color .2s, color .2s, border-color .2s; }
.chip:hover { color: #fff; background: rgba(255,255,255,.09); }
.chip[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.chip:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
#viewLibrary.is-over { outline: 2px dashed rgba(255,255,255,.4); outline-offset: -6px; }

/* post editor: one tidy toolbar (emoji · text tools | AI tools) */
#toolbar #composerTools { padding-left: .6rem; margin-left: .15rem; border-left: 1px solid rgba(255,255,255,.1); }
#toolbar #aiBar { margin-left: auto; }
/* On a phone the toolbar is a three-column grid instead of a pile of wrapped buttons:
     [emoji] [Tidy up] [Clear]
     [Tidy on paste ........] [credits left]
     [Make it clean ........] [# Hashtags]
   The two groups dissolve (display: contents) so their buttons become cells of the grid; the AI group stays hidden until the server says AI is on. */
@media (max-width: 639.98px) {
  #toolbar { display: grid; grid-template-columns: 2rem 1fr 1fr; align-items: center; gap: .5rem; padding: .5rem; }
  #toolbar #composerTools { display: contents; }
  #toolbar #aiBar:not(.hidden) { display: contents; }
  #toolbar .btn { min-height: 2.35rem; width: 100%; white-space: nowrap; }
  #toolbar label[for="toolPaste"] { grid-column: span 2; margin: 0; min-height: 2rem; }
  #toolbar #aiCredits { grid-column: 3; margin: 0; text-align: right; line-height: 1.2; }
  #toolbar #aiClean { grid-column: span 2; }
}

/* ───────── Agent log: the neon terminal of the "Agents" tab (assets/agentlog.js) ───────── */
.term { position: relative; border-radius: 1.25rem; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, rgba(124,58,237,.16), transparent 55%), radial-gradient(100% 80% at 100% 100%, rgba(52,211,153,.10), transparent 55%), #07060d;
  border: 1px solid rgba(167,139,250,.35); box-shadow: 0 0 0 1px rgba(52,211,153,.07), 0 0 34px rgba(124,58,237,.28), 0 0 70px rgba(52,211,153,.07), inset 0 0 50px rgba(124,58,237,.07); }
.term::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.028) 0, rgba(255,255,255,.028) 1px, transparent 1px, transparent 3px); }
.term-bar { display: flex; align-items: center; gap: .45rem; padding: .6rem .9rem; border-bottom: 1px solid rgba(167,139,250,.2); background: rgba(255,255,255,.025); font: 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: rgba(255,255,255,.45); }
.term-dot { width: .6rem; height: .6rem; border-radius: 999px; background: rgba(255,255,255,.18); }
.term-dot:nth-child(1) { background: #fb7185; box-shadow: 0 0 8px #fb7185aa; } .term-dot:nth-child(2) { background: #fbbf24; box-shadow: 0 0 8px #fbbf24aa; } .term-dot:nth-child(3) { background: #34d399; box-shadow: 0 0 8px #34d399aa; }
.term-body { height: min(28rem, 58vh); overflow-y: auto; padding: .85rem 1rem 1rem; font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #bbf7d0; scrollbar-width: thin; scrollbar-color: rgba(167,139,250,.45) transparent; overscroll-behavior: contain; }
.term-body:focus-visible { outline: 2px solid rgba(167,139,250,.7); outline-offset: -2px; }
.term-line { display: block; padding-left: 1.25ch; text-indent: -1.25ch; word-break: break-word; }
.term-time { color: rgba(255,255,255,.32); } 
.term-tag { font-weight: 600; text-shadow: 0 0 10px currentColor; }
.term-msg { color: #86efac; text-shadow: 0 0 9px rgba(52,211,153,.55); }
.term-line.is-err .term-msg { color: #fda4af; text-shadow: 0 0 9px rgba(251,113,133,.55); }
.term-line.is-demo .term-msg { color: #c4b5fd; text-shadow: 0 0 9px rgba(167,139,250,.55); }
.term-sys { color: rgba(255,255,255,.4); }
.term-cursor { display: inline-block; width: .6ch; height: 1.05em; margin-left: .25ch; vertical-align: -.15em; background: #86efac; box-shadow: 0 0 10px #34d399; animation: term-blink 1.05s steps(1) infinite; }
@keyframes term-blink { 50% { opacity: 0; } }
.live-dot { width: .5rem; height: .5rem; border-radius: 999px; background: #34d399; box-shadow: 0 0 10px #34d399; animation: live-pulse 1.8s ease-in-out infinite; }
.live-dot.is-off { background: rgba(255,255,255,.3); box-shadow: none; animation: none; }
@keyframes live-pulse { 50% { opacity: .35; } }
.chip-int { border-radius: 999px; padding: .25rem .7rem; font-size: .72rem; border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.6); background: transparent; cursor: pointer; }
.chip-int:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.chip-int[aria-pressed="true"] { color: #fff; background: rgba(167,139,250,.22); border-color: rgba(167,139,250,.6); box-shadow: 0 0 14px rgba(167,139,250,.25); }
@media (prefers-reduced-motion: reduce) { .term-cursor, .live-dot { animation: none; } }

/* Post cards in the dashboard list: on a phone the buttons drop under the text (indented past the date tile) instead of squeezing it */
@media (max-width: 639px) {
  .pcard { flex-wrap: wrap; row-gap: .75rem; }
  .pcard-main { flex: 1 1 calc(100% - 4.5rem); min-width: 0; }
  .pcard-actions { margin-left: 4.5rem; }
}

/* ───── Analytics page (analytics.html, analytics.js) ───── */
.an-tabs { display: flex; gap: .25rem; overflow-x: auto; padding: .25rem; border-radius: 9999px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.an-tabs::-webkit-scrollbar { display: none; }
.an-tab { flex: none; white-space: nowrap; border-radius: 9999px; padding: .5rem .95rem; font-size: .875rem; color: rgba(255,255,255,.55); transition: background .15s, color .15s; }
.an-tab:hover { color: #fff; }
.an-tab.is-on { background: #fff; color: #0a0a0b; font-weight: 500; }
.an-tab.is-on span { background: rgba(0,0,0,.08); color: rgba(0,0,0,.55); }

.an-kpi { background-image: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 70%); }
.an-kpi-l { font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.an-kpi-v { margin-top: .4rem; font-size: 1.75rem; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-kpi-s { margin-top: .3rem; font-size: .75rem; color: rgba(255,255,255,.4); }
.an-kpi-d { margin-top: .55rem; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .45rem; }
.an-kpi-vs { font-size: .7rem; color: rgba(255,255,255,.35); }
.an-delta { display: inline-flex; align-items: center; border-radius: 9999px; padding: .1rem .5rem; font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-delta.up { background: rgba(52,211,153,.14); color: #6ee7b7; }
.an-delta.down { background: rgba(251,113,133,.14); color: #fda4af; }
.an-delta.flat { background: rgba(255,255,255,.08); color: rgba(255,255,255,.62); }

.an-chart .an-col { transition: opacity .12s; }

.an-post { position: relative; padding-left: 1.15rem; }
.an-post::before { content: ''; position: absolute; left: .55rem; top: .8rem; bottom: .8rem; width: 3px; border-radius: 3px; background: var(--c, rgba(255,255,255,.3)); }

.an-lock { background-image: radial-gradient(120% 130% at 50% 0%, rgba(125,211,252,.11), rgba(255,255,255,0) 62%); border-color: rgba(125,211,252,.2); }
.an-lock-ic { display: inline-block; color: #7dd3fc; }

.an-heat-legend { margin-top: .85rem; display: flex; align-items: center; justify-content: flex-end; gap: .35rem; font-size: .7rem; color: rgba(255,255,255,.4); }
.an-heat-sw { width: 1.1rem; height: .7rem; border-radius: .2rem; }
.an-big { font-size: 2.25rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.an-meter { height: .4rem; border-radius: 9999px; background: rgba(255,255,255,.08); overflow: hidden; }
.an-meter > div { height: 100%; border-radius: inherit; }
.an-post { padding-left: 1.15rem !important; }

/* Phones: the network chips scroll sideways in one row (a long list no longer pushes the page down); the numbers are a little smaller */
@media (max-width: 639px) {
  #chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -.75rem; padding-right: .75rem; scrollbar-width: none; }
  #chips::-webkit-scrollbar { display: none; }
  #chips > button { flex: none; }
  .an-kpi-v { font-size: 1.55rem; }
}
.an-rank { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 1.45rem; height: 1.45rem; border-radius: 9999px; background: rgba(125,211,252,.16); color: #7dd3fc; font-size: .72rem; font-weight: 600; }

/* ───── Analytics: richer charts (tooltips, sparklines, ring, entrance) ───── */
.an-page::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(55% 38% at 12% -4%, rgba(125,211,252,.13), transparent 70%), radial-gradient(45% 34% at 92% 2%, rgba(196,181,253,.11), transparent 70%); }
.an-page .glass-d { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 34px -22px rgba(0,0,0,.9); }
.an-plot { position: relative; }
.an-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 9.5rem; padding: .55rem .7rem; border-radius: .75rem; background: rgba(18,18,22,.96); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 16px 40px -12px rgba(0,0,0,.85); font-size: .75rem; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.an-tip.on { opacity: 1; transform: none; }
.an-tip-h { margin-bottom: .3rem; font-weight: 600; color: rgba(255,255,255,.9); }
.an-tip-r { display: flex; align-items: center; gap: .45rem; color: rgba(255,255,255,.65); line-height: 1.55; }
.an-tip-r i { width: .55rem; height: .55rem; border-radius: .18rem; flex: none; }
.an-tip-r span { flex: 1; }
.an-tip-r b { font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }
.an-tip-t { margin-top: .25rem; padding-top: .3rem; border-top: 1px solid rgba(255,255,255,.1); }
.an-chart .an-hit { fill: rgba(255,255,255,.001); }
.an-chart .an-col:hover .an-hit { fill: rgba(255,255,255,.05); }
.an-chart .an-col { opacity: 1 !important; }
.an-chart .an-seg { transform-box: fill-box; transform-origin: 50% 100%; animation: an-grow .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 14ms); transition: filter .12s; }
.an-chart .an-col:hover .an-seg { filter: brightness(1.18); }
.an-chart .an-cross { opacity: 0; transition: opacity .1s; }
.an-chart.is-hover .an-cross { opacity: 1; }
.an-chart .an-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: an-stroke 1s ease-out both; }
@keyframes an-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes an-stroke { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes an-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.an-kpi { animation: an-rise .5s ease both; animation-delay: var(--d, 0ms); display: flex; flex-direction: column; }
.an-kpi-dot { display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; border-radius: 9999px; vertical-align: .06em; }
.an-spark { display: block; width: 100%; height: 2.1rem; margin-top: auto; padding-top: .6rem; box-sizing: content-box; overflow: visible; }
.an-kpi-d { margin-bottom: .1rem; }
.an-split { display: grid; gap: 1.5rem; align-items: center; grid-template-columns: minmax(0, 1fr); justify-items: center; }
@media (min-width: 768px) { .an-split { grid-template-columns: 11rem minmax(0, 1fr); justify-items: stretch; } }
.an-split > div:last-child { width: 100%; min-width: 0; }
.an-donut { position: relative; width: 11rem; height: 11rem; }
.an-donut svg { width: 100%; height: 100%; }
.an-slice { transition: stroke-width .15s, opacity .15s; cursor: default; }
.an-donut:hover .an-slice { opacity: .55; }
.an-donut .an-slice:hover { opacity: 1; stroke-width: 16; }
.an-donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 2.2rem; }
.an-donut-mid b { font-size: 1.6rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.an-donut-mid span { margin-top: .15rem; font-size: .68rem; line-height: 1.25; color: rgba(255,255,255,.5); }
.an-fill { transform-origin: left; animation: an-fillin .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes an-fillin { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.an-rank-1 { background: rgba(252,211,77,.18); color: #fcd34d; }
.an-rank-2 { background: rgba(203,213,225,.16); color: #cbd5e1; }
.an-rank-3 { background: rgba(253,186,116,.18); color: #fdba74; }
@media (prefers-reduced-motion: reduce) { .an-chart .an-seg, .an-chart .an-draw, .an-kpi, .an-fill { animation: none !important; } }

/* ───── Lightbox: the full-size viewer for images and videos (assets/lightbox.js) ───── */
html.lb-lock { overflow: hidden; }
dialog.lb { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; color: #fff; background: rgba(6,6,9,.94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
dialog.lb::backdrop { background: transparent; }
dialog.lb[open] { animation: lb-in .18s ease-out; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-top { position: absolute; z-index: 4; inset: 0 0 auto 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; background: linear-gradient(180deg, rgba(0,0,0,.7), rgba(0,0,0,0)); }
.lb-title { min-width: 0; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; font-weight: 600; }
.lb-sub { margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; color: rgba(255,255,255,.55); }
.lb-tools { display: flex; flex: none; align-items: center; gap: .5rem; }
.lb-count { padding: 0 .35rem; font-size: .8rem; font-variant-numeric: tabular-nums; color: rgba(255,255,255,.6); }
.lb-group { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem; border-radius: 9999px; background: rgba(255,255,255,.07); }
.lb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 2.2rem; height: 2.2rem; padding: 0 .55rem; border: 0; border-radius: 9999px; background: transparent; color: rgba(255,255,255,.85); font: inherit; font-size: .8rem; cursor: pointer; text-decoration: none; transition: background .12s, color .12s; }
.lb-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.lb-btn:focus-visible, .lb-nav:focus-visible, .lb-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { background: rgba(255,255,255,.09); }
.lb-pct { min-width: 3.1rem; font-variant-numeric: tabular-nums; }
.lb-ic { width: 1.05rem; height: 1.05rem; }
.lb-ic-lg { width: 1.5rem; height: 1.5rem; }
.lb-act-t { display: none; }
@media (min-width: 900px) { .lb-act-t { display: inline; } }
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 4.3rem 1rem 6.4rem; touch-action: none; cursor: default; }
.lb-stage.is-zoomed { cursor: grab; }
.lb-stage.is-drag { cursor: grabbing; }
.lb-pan { display: flex; max-width: 100%; max-height: 100%; transform-origin: 50% 50%; will-change: transform; }
.lb-stage:not(.is-drag) .lb-pan { transition: transform .16s ease-out; }
.lb-media { display: block; max-width: 100%; max-height: calc(100vh - 10.7rem); max-height: calc(100dvh - 10.7rem); object-fit: contain; border-radius: .9rem; background: rgba(255,255,255,.03); box-shadow: 0 30px 80px -24px rgba(0,0,0,.95); user-select: none; -webkit-user-drag: none; }
video.lb-media { background: #000; }
.lb-stage:not(.is-zoomed) img.lb-media { cursor: zoom-in; }
.lb-spin { position: absolute; width: 2.4rem; height: 2.4rem; border-radius: 9999px; border: 3px solid rgba(255,255,255,.14); border-top-color: #fff; animation: lb-spin .8s linear infinite; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lb-err { position: absolute; padding: .8rem 1.1rem; border-radius: .9rem; background: rgba(239,68,68,.12); border: 1px solid rgba(248,113,113,.3); color: #fca5a5; font-size: .9rem; }
.lb-nav { position: absolute; z-index: 4; top: 50%; display: flex; align-items: center; justify-content: center; width: 2.9rem; height: 2.9rem; margin-top: -2.45rem; border: 1px solid rgba(255,255,255,.1); border-radius: 9999px; background: rgba(20,20,26,.6); color: #fff; cursor: pointer; transition: background .12s, transform .12s; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-prev { left: .9rem; }
.lb-next { right: .9rem; }
.lb-prev:active { transform: translateX(-2px); }
.lb-next:active { transform: translateX(2px); }
.lb-strip { position: absolute; z-index: 4; inset: auto 0 0 0; display: flex; justify-content: safe center; gap: .45rem; overflow-x: auto; padding: .9rem 1rem 1rem; background: linear-gradient(0deg, rgba(0,0,0,.72), rgba(0,0,0,0)); scrollbar-width: none; }
.lb-strip::-webkit-scrollbar { display: none; }
.lb-thumb { position: relative; flex: none; width: 3.4rem; height: 3.4rem; padding: 0; border: 0; border-radius: .7rem; overflow: hidden; background: rgba(255,255,255,.08); cursor: pointer; opacity: .55; transition: opacity .12s, transform .12s, box-shadow .12s; }
.lb-thumb:hover { opacity: .9; }
.lb-thumb.is-on { opacity: 1; transform: translateY(-2px); box-shadow: 0 0 0 2px #fff; }
.lb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-vid { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: .8rem; color: rgba(255,255,255,.8); }
@media (max-width: 639px) {
  .lb-top { padding: .6rem .7rem; }
  .lb-tools { gap: .3rem; }
  .lb-stage { padding: 3.9rem .5rem 5.6rem; }
  .lb-media { max-height: calc(100vh - 9.5rem); max-height: calc(100dvh - 9.5rem); border-radius: .7rem; }
  .lb-nav { width: 2.5rem; height: 2.5rem; }
  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
  .lb-thumb { width: 2.9rem; height: 2.9rem; }
  .lb-pct { display: none; }
  .lb-group[data-lb="zoomtools"], .lb-hide-sm { display: none; }
}
@media (hover: none) { .lb-nav { display: none; } }
@media (max-height: 520px) { .lb-strip { display: none; } .lb-stage { padding-bottom: 1rem; } .lb-media { max-height: calc(100dvh - 6rem); } }
@media (prefers-reduced-motion: reduce) { dialog.lb[open], .lb-spin { animation: none; } .lb-stage:not(.is-drag) .lb-pan { transition: none; } }

/* The "open full size" layer on a library tile */
.lib-open { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 0; padding: 0; background: transparent; color: #fff; cursor: zoom-in; transition: background .15s; }
.lib-open:hover, .lib-open:focus-visible { background: rgba(0,0,0,.32); }
.lib-open:focus-visible { outline: 2px solid #fff; outline-offset: -3px; border-radius: inherit; }
.lib-open-ic { display: flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 9999px; background: rgba(0,0,0,.55); opacity: 0; transform: scale(.88); transition: opacity .15s, transform .15s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lib-open:hover .lib-open-ic, .lib-open:focus-visible .lib-open-ic { opacity: 1; transform: none; }
@media (hover: none) { .lib-open-ic { opacity: 0; } }
.lp-view { position: absolute; right: .35rem; top: .35rem; display: flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; padding: 0; border: 0; border-radius: 9999px; background: rgba(0,0,0,.6); color: #fff; cursor: zoom-in; opacity: 0; transition: opacity .12s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lp-cell:hover .lp-view, .lp-view:focus-visible { opacity: 1; }
.lp-view:focus-visible { outline: 2px solid #fff; }
@media (hover: none) { .lp-view { opacity: 1; } }

/* ── Motion: one set of curves and speeds for everything that moves (buttons, menus, panels, pages) ─────────────────────────────────── */
:root { --ease-out: cubic-bezier(.16,1,.3,1); --ease-io: cubic-bezier(.65,0,.35,1); }

/* page to page on the same site: a short cross-fade (browsers that cannot do it just switch, as before) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* buttons: they lift a little under the finger, press in, glow, and show where the keyboard is */
.btn { transition: opacity .2s, transform .25s var(--ease-out), background-color .2s, color .2s, border-color .2s, box-shadow .3s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(.96); transition-duration: .08s; }
.btn-white:hover:not(:disabled) { box-shadow: 0 10px 28px -12px rgba(255,255,255,.55); }
.btn:focus-visible { outline: 2px solid rgba(255,255,255,.9); outline-offset: 3px; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .7; }
#accountChip { transition: background-color .2s, transform .25s var(--ease-out); }
#accountChip:active { transform: scale(.96); }
#accountChip:hover { transform: translateY(-1px); }

/* things that arrive: a menu opening, a button appearing, a number changing, a block of content swapping in */
.menu-in { animation: menu-in .2s var(--ease-out) both; transform-origin: top right; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.95); } to { opacity: 1; transform: none; } }
.rise { animation: rise .38s var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 10) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fab-in { animation: fab-in .55s var(--ease-out) backwards; }
@keyframes fab-in { from { opacity: 0; transform: translateY(18px) scale(.6); } to { opacity: 1; transform: none; } }
.badge-pop { animation: badge-pop .45s var(--ease-out); }
@keyframes badge-pop { 0% { transform: scale(.4); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* a panel that folds open and shut: the height eases instead of jumping (feedback block) */
.fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-out); }
.fold.is-open { grid-template-rows: 1fr; }
.fold > .fold-in { min-height: 0; overflow: hidden; visibility: hidden; opacity: 0; transition: visibility 0s linear .45s, opacity .3s ease; }
.fold.is-open > .fold-in { visibility: visible; opacity: 1; transition-delay: 0s, .08s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .btn, #accountChip { transition: opacity .2s, background-color .2s, color .2s, border-color .2s; }
  .btn:hover:not(:disabled), .btn:active:not(:disabled), #accountChip:hover, #accountChip:active { transform: none; }
  .menu-in, .rise, .fab-in, .badge-pop { animation: none; }
  .fold, .fold > .fold-in { transition: none; }
  dialog.vane-dialog, dialog.vane-dialog::backdrop { transition: none; }
}
