/* ==========================================================================
   Linkart — dashboard design system
   ========================================================================== */

/* Google Sans Flex — variable font (wght 300-800), vendored from Google Fonts */
@font-face {
  font-family: "Google Sans Flex";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/fonts/google-sans-flex-latin-10e3239c.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Google Sans Flex";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/fonts/google-sans-flex-latin-ext-f7ce24f0.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Neo-brutalist palette — shared with the landing/auth pages: cream canvas,
     ink borders, hard offset shadows, ink primary, yellow accent. Tuned to the
     Dashboard.dc design import. */
  --ink: #141310;
  --ink-2: #2b2f3d;
  --ink-3: #454a63;
  --bg: #F3EFE4;
  --sidebar: #F6F2E7;
  --surface: #ffffff;
  --card: #ffffff;
  --fill: #EFEADD;
  --text: #23262f;
  --muted: #676d84;
  --border: rgba(20, 19, 16, 0.14);
  --border-strong: #141310;
  --primary: #141310;
  --primary-dark: #000000;
  --primary-soft: #ECEAE1;
  --violet: #141310;
  --lime: #FFD84D;
  --gold: #F1BE48;
  --blue: #2E6BFF;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Stat icon tints */
  --tint-blue: #EAF0FF;
  --tint-green: #E6F8EE;
  --tint-yellow: #FFF3D6;
  --tint-violet: #F1E9FF;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --danger-border: #fecdca;
  --success: #067647;
  --success-soft: #ecfdf3;
  --success-border: #abefc6;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --radius: 16px;
  --radius-sm: 10px;
  --edge: clamp(1.25rem, 3vw, 3rem);
  --nav-h: 3.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ring: 0 0 0 3px rgba(22, 24, 29, 0.2);
  /* Hard offset shadows in ink — the brutalist signature. */
  --shadow-sm: 2px 2px 0 rgba(22, 24, 29, 0.9);
  --shadow-md: 3px 4px 0 rgba(22, 24, 29, 0.9);
  --shadow-lg: 8px 10px 0 rgba(22, 24, 29, 0.24);
  --shadow-card: none;
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --font: "Space Grotesk", "Google Sans Flex", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* Ensure [hidden] wins over components that set an explicit display (search filter) */
[hidden] { display: none !important; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--lime); color: var(--ink); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

input, textarea { caret-color: var(--primary); }
::placeholder { color: #a2a7bc; opacity: 1; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--text);
}

/* Respect reduced-motion preferences everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Smooth cross-page fade (Turbo view transitions) */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: fade-out 0.12s ease both; }
  ::view-transition-new(root) { animation: fade-in 0.18s ease both; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Top bar
   ========================================================================== */

/* Icons */
.icon-svg { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.inline-lock { color: var(--muted); vertical-align: -2px; margin-right: 1px; }
.hero__eyebrow .icon-svg { color: var(--lime); }
.feature__icon .icon-svg { color: var(--primary); }
.footer__logo span { color: #fff; }

/* Brand mark */
.logo-mark {
  flex-shrink: 0;
  display: inline-block;
  object-fit: contain;
}

/* Signed-out floating nav */
.nav-wrap { position: sticky; top: 0.85rem; z-index: 40; padding: 0 1rem; }
.nav {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
  border: 1px solid rgba(16, 19, 34, 0.08);
  border-radius: 999px; padding: 0.5rem 0.6rem 0.5rem 1rem;
  box-shadow: 0 1px 2px rgba(16, 19, 34, 0.04), 0 12px 32px -12px rgba(16, 19, 34, 0.18);
}
.nav__brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.02em;
}
.nav__brand:hover { text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: 0.2rem; margin-left: auto; }
.nav__links a, .nav__links .linklike {
  color: var(--ink-2); font-weight: 600; font-size: 0.86rem;
  padding: 0.42rem 0.85rem; border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav__links a:hover, .nav__links .linklike:hover {
  background: var(--primary-soft); color: var(--primary); text-decoration: none;
}
.nav__right { display: flex; align-items: center; gap: 0.45rem; }

.main { max-width: 1040px; margin: 0 auto; padding: 2.25rem 1.5rem 5rem; }
.main > * { animation: rise-in 0.35s ease both; }

/* ==========================================================================
   Signed-in shell: vertical sidebar + content
   ========================================================================== */

.shell { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid rgba(22, 24, 29, 0.32);
  display: flex; flex-direction: column;
  padding: 1.15rem 0.9rem 1rem;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.02em;
  padding: 0.35rem 0.6rem 1.15rem;
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__top { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem;
  height: 66px; margin: -1.15rem -0.9rem 0.9rem; padding: 0 0.9rem;
  border-bottom: 3px solid var(--ink); }
.sidebar__top .sidebar__brand { padding: 0; }
.sidebar__collapse {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; margin-top: 0.15rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink);
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar__collapse:hover { background: var(--ink); color: #fff; }
.sidebar__nav { display: flex; flex-direction: column; gap: 0.4rem; }

/* Collapsed rail — icon above a small label, centered */
.shell.is-collapsed .sidebar { width: 96px; padding-left: 0.55rem; padding-right: 0.55rem; }
.shell.is-collapsed .sidebar__top { flex-direction: column; align-items: center; gap: 0.5rem;
  height: auto; margin: -1.15rem -0.55rem 0.6rem; padding: 0.9rem 0.55rem; }
.shell.is-collapsed .sidebar__brand { padding: 0.35rem 0 0.4rem; }
.shell.is-collapsed .sidebar__brand span:not(.logo-mark),
.shell.is-collapsed .account-card__meta { display: none; }
.shell.is-collapsed .sidebar__nav { gap: 0.5rem; }
/* Section labels collapse into a divider line between nav groups. */
.shell.is-collapsed .sidebar__section {
  display: block; font-size: 0; line-height: 0; height: 0;
  width: 56%; margin: 0.55rem auto 0.35rem; padding: 0;
  border-top: 3px solid var(--ink);
}
.shell.is-collapsed .sidebar__section:first-child { display: none; }
.shell.is-collapsed .sidebar__link {
  flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  text-align: center; padding: 0.55rem 0.3rem;
}
.shell.is-collapsed .sidebar__link span { display: block; font-size: 0.66rem; font-weight: 700; line-height: 1.1; }
.shell.is-collapsed .sidebar__link.is-active::before { display: none; }
.shell.is-collapsed .account-card { justify-content: center; padding: 0.45rem; }
.shell.is-collapsed .sidebar__signout {
  flex-direction: column; gap: 0.2rem; padding: 0.5rem 0.3rem;
}
.shell.is-collapsed .sidebar__signout span { font-size: 0.66rem; font-weight: 700; }
.sidebar__section {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 1.1rem 0 0.35rem; padding: 0 0.6rem;
}
.sidebar__section:first-child { margin-top: 0; }
.sidebar__link {
  position: relative; display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem; border-radius: 9px; border: 2px solid transparent;
  font-weight: 700; font-size: 0.9rem; color: var(--ink-2);
  transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease), transform 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.sidebar__link .icon-svg { color: var(--ink-3); transition: color 0.12s ease, transform 0.14s var(--ease); }
.sidebar__link:hover:not(.is-active) {
  background: #fff; color: var(--ink); text-decoration: none;
  border-color: var(--ink); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink);
}
.sidebar__link:hover .icon-svg { color: var(--ink); }
.sidebar__link.is-active {
  background: var(--primary); color: #fff;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.sidebar__link.is-active .icon-svg { color: #fff; }
.sidebar__spacer { flex: 1; min-height: 1.5rem; }
.sidebar__account { display: flex; flex-direction: column; gap: 0.55rem; }
.account-card {
  display: flex; align-items: center; gap: 0.6rem;
  background: #fff; border: 2px solid var(--ink);
  border-radius: 10px; padding: 0.55rem 0.65rem; box-shadow: 2px 2px 0 var(--ink);
}
.account-card__avatar {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); border: 2px solid var(--ink);
  color: var(--lime); font-size: 0.85rem; font-weight: 800;
}
.account-card__meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.account-card__email { font-size: 0.8rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card__plan { font-size: 0.72rem; color: var(--muted); }
.sidebar__signout {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem; width: 100%;
  padding: 0.55rem; border: 2px solid var(--ink); background: var(--surface);
  border-radius: 8px; font-family: var(--font); font-weight: 700; font-size: 0.85rem;
  color: var(--ink); cursor: pointer; box-shadow: 2px 2px 0 var(--ink);
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.sidebar__signout:hover { background: var(--danger-soft); color: var(--danger); transform: translate(2px, 2px); box-shadow: none; }
.sidebar__signout .icon-svg { color: currentColor; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content .main { max-width: 1180px; width: 100%; padding-top: 1.9rem; }

/* Signed-in top bar — page location, page-scoped search, activity bell */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  height: 66px; padding: 0 var(--edge);
  background: rgba(246, 244, 236, 0.85);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(22, 24, 29, 0.32);
}
.topbar__title { margin: 0; font-size: 1.18rem; font-weight: 800; letter-spacing: -0.02em; }
.topbar__tools { display: flex; align-items: center; gap: 0.7rem; margin-left: auto; }
.topbar__search {
  display: flex; align-items: center; gap: 0.5rem;
  background: #fff; border: 2px solid var(--ink);
  border-radius: 8px; padding: 0.4rem 0.85rem; width: 260px; max-width: 42vw;
  box-shadow: 2px 2px 0 var(--ink);
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease), background 0.14s var(--ease);
}
.topbar__search:focus-within { border-color: var(--primary); box-shadow: 2px 2px 0 var(--ink), var(--ring); }
.topbar__search .icon-svg { color: var(--muted); flex-shrink: 0; }
.topbar__search input {
  border: none; background: none; outline: none; width: 100%;
  font-family: var(--font); font-size: 0.86rem; color: var(--text);
}
@media (max-width: 620px) {
  .topbar { height: 58px; gap: 0.6rem; }
  .topbar__search { width: 44px; padding: 0.4rem; }
  .topbar__search input { display: none; }
  .topbar__search:focus-within { width: 200px; }
  .topbar__search:focus-within input { display: block; }
}

@media (max-width: 880px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; z-index: 40; width: 100%; height: auto;
    flex-direction: row; align-items: center; gap: 0.4rem;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 0.55rem 1rem;
  }
  .sidebar__brand { padding: 0 0.5rem 0 0.2rem; }
  .sidebar__nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 0.1rem; scrollbar-width: none; }
  .sidebar__nav::-webkit-scrollbar { display: none; }
  .sidebar__section { display: none; }
  .sidebar__link span { display: none; }
  .sidebar__link { padding: 0.5rem; }
  .sidebar__link.is-active::before { display: none; }
  .sidebar__spacer { display: none; }
  .sidebar__account { flex-direction: row; align-items: center; margin-left: auto; gap: 0.4rem; }
  .account-card { padding: 0.3rem; border: none; background: transparent; }
  .account-card__meta { display: none; }
  .sidebar__signout { width: auto; padding: 0.45rem 0.7rem; }
  .sidebar__signout span { display: none; }
}

/* ==========================================================================
   Flash toasts
   ========================================================================== */

.flash-stack {
  position: fixed; top: 1.25rem; right: 1.25rem; z-index: 100;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: 420px;
}
.flash {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.1rem; border-radius: 12px; font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: toast-in 0.3s cubic-bezier(0.21, 1.02, 0.73, 1) both, toast-out 0.4s ease 5s both;
}
.flash .icon-svg { flex-shrink: 0; }
.flash--notice { background: var(--ink); color: #fff; }
.flash--notice .icon-svg { color: var(--lime); }
.flash--alert { background: var(--danger); color: #fff; }
.flash--alert .icon-svg { color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); visibility: hidden; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn, button.btn, input.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.15rem; cursor: pointer; white-space: nowrap;
  border-radius: 8px; font-size: 0.88rem; font-weight: 700; font-family: var(--font);
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease), background 0.14s var(--ease), border-color 0.14s var(--ease);
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 0 0 0 rgba(22, 24, 29, 0.9); text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: none; transition-duration: 0.06s; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn--primary, button.btn--primary, input.btn--primary {
  background: var(--ink); color: #fff; border: 2px solid var(--ink);
}
.btn--danger, button.btn--danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); }
.btn--ghost, button.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn--ghost:hover { background: var(--primary-soft); border-color: transparent; box-shadow: none; color: var(--primary); transform: none; }
.btn--small { padding: 0.35rem 0.8rem; font-size: 0.8rem; box-shadow: 2px 2px 0 rgba(22, 24, 29, 0.9); }
.btn--icon { padding: 0.35rem 0.55rem; font-size: 0.8rem; }
.btn--lime, button.btn--lime {
  background: var(--lime); color: var(--ink); border: 2px solid var(--ink);
}
/* Light sweep on the marquee buttons — fires on hover, tasteful, not gimmicky */
.btn--primary, .btn--lime { position: relative; overflow: hidden; }
.btn--primary::after, .btn--lime::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.4) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform 0.55s var(--ease);
}
.btn--primary:hover::after, .btn--lime:hover::after { transform: translateX(130%); }
.linklike, button.linklike {
  background: none; border: none; padding: 0; color: var(--ink-2);
  font-size: 0.88rem; font-weight: 600; cursor: pointer; font-family: var(--font);
}
.linklike:hover { color: var(--primary); text-decoration: none; }

/* ==========================================================================
   Cards & forms
   ========================================================================== */

.card {
  background: var(--card); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.card h2 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 0.6rem; }
.card__head { margin-bottom: 1.2rem; }
.card__sub { margin: 0.3rem 0 0; font-size: 0.83rem; color: var(--muted); }
.card__hint { color: var(--muted); font-size: 0.85rem; }
.crumb {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 0.85rem;
}
.crumb:hover { color: var(--primary); text-decoration: none; }
.step-num {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 0.8rem; font-weight: 800;
}

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; font-size: 0.82rem; margin-bottom: 0.35rem; color: var(--ink-2); }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=url], .field input[type=datetime-local], .field input[type=date],
.field textarea, .field select, .brand-search input {
  width: 100%; padding: 0.65rem 0.9rem; border: 2px solid var(--ink);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: var(--font);
  background: #fff; color: var(--text);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input[type=datetime-local], .field input[type=date] { color-scheme: light; }
/* Styled file picker — matches the pill-button system */
.field input[type=file] { width: 100%; font-size: 0.85rem; color: var(--muted); font-family: var(--font); }
.field input[type=file]::file-selector-button {
  margin-right: 0.8rem; padding: 0.5rem 0.95rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-family: var(--font); font-weight: 700; font-size: 0.82rem;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease), transform 0.1s var(--ease);
}
.field input[type=file]::file-selector-button:hover { border-color: var(--muted); background: var(--bg); }
.field input[type=file]::file-selector-button:active { transform: scale(0.97); }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus, .field select:focus, .brand-search input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: var(--ring);
}
.field select, .theme-toolbar select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23676d84' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px;
  padding-right: 2.5rem; cursor: pointer;
}
.field .hint { color: var(--muted); font-size: 0.78rem; margin-top: 0.3rem; }
.toggle-field {
  display: flex; align-items: flex-start; gap: 0.7rem; cursor: pointer;
  padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.toggle-field:hover { border-color: var(--border-strong); }
.toggle-field:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.toggle-field input[type=checkbox] { width: 1.05rem; height: 1.05rem; margin-top: 0.15rem; accent-color: var(--primary); flex-shrink: 0; }
.toggle-field span { display: block; }
.toggle-field strong { display: block; font-size: 0.85rem; color: var(--ink-2); font-weight: 700; margin-bottom: 0.15rem; }
.toggle-field .hint { margin-top: 0; font-weight: 400; }
.avatar-current { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.avatar-current__img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); }
.avatar-current__remove { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--ink-3); cursor: pointer; }
.avatar-current__remove input { accent-color: var(--primary); }
.schedule-fields { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9rem 1rem 0.4rem; margin-bottom: 1rem; }
.schedule-fields legend { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); padding: 0 0.4rem; }
.schedule-fields__opt { font-weight: 400; color: var(--ink-3); font-size: 0.78rem; }
.schedule-fields__row { display: flex; gap: 1rem; flex-wrap: wrap; }
.schedule-fields__row .field { flex: 1; min-width: 160px; }
.sched-badge { display: inline-block; margin-left: 0.4rem; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.1rem 0.4rem; border-radius: 999px; vertical-align: middle; }
.sched-badge--on   { background: var(--primary-soft); color: var(--primary); }
.sched-badge--soon { background: var(--warn-soft, #fff4e0); color: var(--warn, #b45309); }
.sched-badge--off  { background: var(--danger-soft); color: var(--danger); }
.errors {
  background: var(--danger-soft); border: 1px solid var(--danger-border); color: var(--danger);
  border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.88rem;
}
.errors ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-card { max-width: 430px; margin: 3.5rem auto; }
.auth-card .card { padding: 2.5rem; box-shadow: var(--shadow-md); }
.auth-card h1 { font-size: 1.5rem; margin: 0 0 0.4rem; }
.auth-card .auth-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.5rem; }
.auth-card .btn { width: 100%; padding: 0.75rem; }
.auth-links { margin-top: 1.25rem; font-size: 0.85rem; color: var(--muted); text-align: center; }
.auth-links a { font-weight: 700; }

/* ==========================================================================
   Dashboard
   ========================================================================== */

.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem; }
.page-header h1 { margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; }
.page-header .sub { color: var(--muted); font-size: 0.88rem; margin: 0.2rem 0 0; }
.page-header .eyebrow {
  color: var(--primary); font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; margin: 0 0 0.2rem;
}

/* Stat tiles — mono label, tinted icon, big value, live progress bar */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.4rem; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; box-shadow: 4px 4px 0 var(--ink);
  display: flex; flex-direction: column; gap: 0.85rem;
}
.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.stat__icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--ink); border: 2px solid var(--ink);
}
.stat__icon--blue { background: var(--tint-blue); }
.stat__icon--green { background: var(--tint-green); }
.stat__icon--yellow { background: var(--tint-yellow); }
.stat__icon--violet { background: var(--tint-violet); }
.stat__label { font-family: var(--mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-size: 2.25rem; line-height: 1; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: 0.9rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.stat__bar { display: flex; align-items: center; gap: 0.5rem; }
.stat__bar-track { flex: 1; height: 9px; background: var(--fill); border: 2px solid var(--ink); border-radius: 20px; overflow: hidden; }
.stat__bar-fill { display: block; height: 100%; background: #2FBF71; }
.stat__bar-pct { font-family: var(--mono); font-size: 0.66rem; font-weight: 700; color: var(--muted); }

/* Icons inside buttons */
.btn .icon-svg { margin: 0 -0.1rem; }
.empty__art .icon-svg { color: var(--primary); }

.page-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
@media (max-width: 1100px) { .page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .page-grid { grid-template-columns: 1fr; } }
.page-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 1.4rem; display: flex; flex-direction: column; gap: 0.95rem;
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.page-card:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--ink); }
.page-card.pf-hide { display: none; }

/* Collapsible cards: collapsed shows just the head + a compact info line. */
.page-grid { align-items: start; }
.page-card__toggle {
  margin-left: auto; flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink);
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.page-card__toggle:hover { background: var(--ink); color: #fff; }
.page-card--collapsible.is-expanded .page-card__toggle .icon-svg { transform: rotate(180deg); }
.page-card__compact { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.page-card--collapsible.is-expanded .page-card__compact { display: none; }
.page-card--collapsible:not(.is-expanded) .chip-cluster,
.page-card--collapsible:not(.is-expanded) .page-card__nolinks,
.page-card--collapsible:not(.is-expanded) .url-pill,
.page-card--collapsible:not(.is-expanded) .page-card__meta,
.page-card--collapsible:not(.is-expanded) .page-card__actions { display: none; }

/* Dashboard header filters */
.page-header__tools { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.page-filters { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 1.5rem; }
.dash-greeting { margin: 0 0 1.5rem; }
.dash-greeting__title { margin: 0 0 0.3rem; font-size: clamp(1.7rem, 3.4vw, 2.15rem); font-weight: 700; letter-spacing: -0.03em; }
.dash-greeting__sub { margin: 0; font-size: 0.95rem; font-weight: 500; color: var(--ink-3); }
.page-filters__title { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.page-filters__controls { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.pf-select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font); font-size: 0.88rem; font-weight: 700; color: var(--ink);
  background-color: var(--surface); border: 2px solid var(--ink); border-radius: 8px;
  padding: 0.6rem 2.2rem 0.6rem 1.15rem; cursor: pointer; box-shadow: var(--shadow-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2316181D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 15px;
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.pf-select:hover { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.page-card__head { display: flex; align-items: center; gap: 0.85rem; }
.page-card__avatar {
  width: 54px; height: 54px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
  background: #fff;
}
.page-card__id { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.page-card__title {
  font-size: 1.2rem; font-weight: 800; margin: 0; color: var(--ink); line-height: 1.15;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.page-card__meta { display: flex; gap: 0.6rem; align-items: center; margin: 0; flex-wrap: wrap; }
.page-card__updated { margin-left: auto; }
.page-card__actions {
  display: flex; align-items: center; gap: 0.35rem;
  border-top: 1px solid var(--border); padding-top: 1rem; margin-top: auto;
}
.page-card__actions form { margin: 0; display: inline-flex; }
.page-card__updated { font-size: 0.82rem; color: var(--muted); text-align: right; }

/* Page-card actions: one primary Edit + compact icon actions */
.pa-edit {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.95rem; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 0.83rem; font-weight: 600;
  border: 2px solid var(--ink);
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.pa-edit svg { color: #fff; }
.pa-edit:hover { background: #0a0d18; color: #fff; text-decoration: none; box-shadow: var(--shadow-sm); }

.pa-group { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.pa-icon {
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: var(--surface); border: 2px solid var(--ink);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.pa-icon:hover { background: var(--ink); color: #fff; }
.pa-icon--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.pa-icon--star { background: var(--lime); color: var(--ink); }
.pa-icon--star:hover { background: var(--ink); color: var(--lime); }

/* Featured section */
.featured { margin-bottom: 2rem; }
.featured__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.featured__head h2 { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; }
.featured__head h2 .icon-svg { color: var(--gold); }
.featured__new { margin-left: auto; }
.featured .page-card { border-color: var(--ink); box-shadow: 3px 4px 0 var(--gold); }

.chip-cluster { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.chip-cluster .icon-chip {
  width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.chip-cluster .icon-chip img { width: 15px; height: 15px; }
.chip-cluster__more {
  width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--lime); font-size: 0.66rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.page-card__nolinks {
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
  padding: 0.35rem 0;
}

.url-pill {
  display: flex; align-items: center; gap: 0.45rem; width: 100%;
  background: var(--fill); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.3rem 0.4rem 0.3rem 0.9rem;
  font-size: 0.78rem; color: var(--muted);
}
.url-pill__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Copy control — icon only, pushed to the far right of the pill */
.url-pill button {
  background: var(--surface); color: var(--ink-2); cursor: pointer; margin-left: auto;
  width: 26px; height: 26px; padding: 0; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; font-family: var(--font);
  transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}
.url-pill button .icon-svg { color: currentColor; }
.url-pill button:active { transform: scale(0.9); }
.url-pill button:hover { background: var(--ink); color: #fff; }
.url-pill--lg button { width: 30px; height: 30px; }

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.6rem; border-radius: 8px; border: 2px solid var(--ink);
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge--live { background: #12a150; color: #fff; }
.badge--live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); animation: live-ping 2.2s ease-out infinite;
}
@keyframes live-ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5); }
  60%, 100% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); }
}
.badge--draft { background: var(--lime); color: var(--ink); }
.badge--pending { background: var(--warn-soft); color: var(--warn); }

.empty {
  text-align: center; color: var(--muted); padding: 4.5rem 1.5rem;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.empty:hover { border-color: var(--primary); background: linear-gradient(180deg, var(--surface), rgba(238, 236, 255, 0.35)); }
.empty__art {
  width: 72px; height: 72px; margin: 0 auto 1.25rem; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
  background: linear-gradient(135deg, var(--primary-soft), #f3e8ff);
}
.empty h3 { margin: 0 0 0.35rem; color: var(--ink); }
.empty p { margin: 0 0 1.5rem; font-size: 0.9rem; }

/* First-run onboarding */
.onboard {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2.5rem; overflow: hidden; position: relative;
}
.onboard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 120% at 100% 0%, rgba(22, 24, 29, 0.08), transparent 55%);
}
.onboard__intro { position: relative; }
.onboard__intro h2 { margin: 0.35rem 0 0.6rem; font-size: 1.5rem; color: var(--ink); line-height: 1.2; }
.onboard__lead { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.95rem; max-width: 34ch; }
.onboard__steps { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.onboard__steps li {
  display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.85rem 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.onboard__steps li:hover { transform: translateX(3px); border-color: var(--primary); }
.onboard__num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), #f3e8ff);
}
.onboard__steps strong { display: block; color: var(--ink); font-size: 0.92rem; }
.onboard__steps span { display: block; color: var(--muted); font-size: 0.84rem; margin-top: 0.15rem; }
.btn--lg { padding: 0.8rem 1.4rem; font-size: 0.98rem; }
@media (max-width: 720px) { .onboard { grid-template-columns: 1fr; padding: 1.75rem; } }

/* ==========================================================================
   Builder
   ========================================================================== */

/* Builder hero — light profile card: cover banner, overlapping avatar,
   identity on the left, share + publish controls on the right. */
.builder-hero {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}
.builder-hero__cover {
  height: 40px; position: relative;
  background: linear-gradient(120deg, var(--primary) 0%, var(--violet) 58%, var(--primary) 100%);
}
.builder-hero__cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(420px 160px at 88% -30%, rgba(255, 255, 255, 0.35), transparent 70%),
    radial-gradient(300px 200px at 10% 130%, rgba(217, 242, 79, 0.28), transparent 70%);
}
.builder-hero__body {
  display: flex; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap;
  padding: 0 1.75rem 1.5rem;
}
.builder-hero__avatar {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 5px solid var(--surface); background: var(--surface);
  margin-top: -30px; box-shadow: var(--shadow-sm);
}
.builder-hero__id { flex: 1; min-width: 200px; padding-bottom: 0.15rem; }
.builder-hero__badges { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.builder-hero__name { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.builder-hero__bio { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; max-width: 52ch; }
.builder-hero__share {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.55rem;
  margin-left: auto; padding-bottom: 0.15rem;
}
.builder-hero__share-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
  margin-top: 0.5rem; margin-bottom: 0.35rem;
}
.builder-hero__actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.url-pill--lg { padding: 0.4rem 0.45rem 0.4rem 1rem; font-size: 0.85rem; }
.url-pill--lg button { padding: 0.35rem 0.85rem; font-size: 0.78rem; }
@media (max-width: 720px) {
  .builder-hero__body { flex-direction: column; align-items: stretch; }
  .builder-hero__share { align-items: stretch; margin-left: 0; }
  .builder-hero__actions { justify-content: flex-start; }
}

.link-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.8rem 0.9rem; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 0.6rem;
  background: #fff; transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.link-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.link-row .icon-chip, .entry-row .icon-chip {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.link-row .icon-chip img, .entry-row .icon-chip img { width: 20px; height: 20px; }
.link-row__name { font-weight: 700; white-space: nowrap; }
.link-row__target {
  color: var(--muted); font-size: 0.82rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-row__handle {
  color: var(--border-strong); font-weight: 700; letter-spacing: -1.5px;
  user-select: none; flex-shrink: 0; font-size: 0.9rem; cursor: grab;
  transition: color 0.12s ease;
}
.link-row:hover .link-row__handle { color: var(--muted); }
.link-row__handle:active { cursor: grabbing; }
.link-row.is-dragging {
  opacity: 0.85; border-color: var(--primary);
  box-shadow: var(--shadow-md); cursor: grabbing;
}
.link-list.dragover-active .link-row:not(.is-dragging) { transition: transform 0.12s ease; }
.link-row__pos {
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  background: var(--fill); border-radius: 6px; padding: 0.1rem 0.45rem; flex-shrink: 0;
}
.link-row__actions {
  display: flex; gap: 0.15rem; align-items: center; flex-shrink: 0;
}
.link-row__actions form { display: contents; }
.row-icon {
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.row-icon .icon-svg { color: currentColor; }
.row-icon:hover { background: var(--bg); color: var(--ink); border-color: var(--border); text-decoration: none; }
.row-icon--danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }

/* Brand picker */
.brand-search { margin-bottom: 1rem; position: relative; }
.brand-search::before {
  content: ""; position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23676d84' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.brand-search input { padding-left: 2.4rem; }
.brand-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 0.6rem; max-height: 420px; overflow-y: auto; padding: 0.25rem;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.brand-grid::-webkit-scrollbar { width: 8px; }
.brand-grid::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.brand-option { position: relative; }
.brand-option input { position: absolute; opacity: 0; pointer-events: none; }
.brand-option .button {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.6rem 0.5rem; border-radius: 10px; font-size: 0.82rem;
  font-weight: 700; cursor: pointer; margin: 0; min-height: 44px;
  transition: transform 0.1s ease, outline-color 0.1s ease;
}
.brand-option .button:hover { transform: translateY(-1px); }
.brand-option .button .icon { width: 18px; height: 18px; }
.brand-option input:checked + .button {
  outline: 3px solid var(--primary); outline-offset: 2px;
}
.brand-option input:checked + .button::after { content: "✓"; font-weight: 800; }
.brand-option--hidden { display: none; }
.brand-picker__footer {
  position: sticky; bottom: 0; background: var(--surface); padding-top: 1rem;
  display: flex; align-items: center; gap: 1rem; border-top: 1px solid var(--border); margin-top: 1rem;
}

/* Username entry rows */
.entry-row {
  display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: start;
  padding: 1.1rem 0; border-bottom: 1px solid var(--border);
}
.entry-row:last-of-type { border-bottom: none; }
.entry-row__brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }

/* ==========================================================================
   Live preview phone
   ========================================================================== */

.split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.75rem; align-items: start; }

/* Builder: mini step-nav rail + cards + preview */
.builder-split { display: grid; grid-template-columns: 72px minmax(0, 1fr) 330px; gap: 1.5rem; align-items: start; }
.builder-steps { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 0.55rem; }
.builder-step {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding: 0.6rem 0.3rem; border: 2px solid var(--ink); border-radius: 11px;
  background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background 0.12s ease, color 0.12s ease;
}
.builder-step:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); text-decoration: none; }
.builder-step__num {
  width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--lime); border: 2px solid var(--ink); font-weight: 800; font-size: 0.88rem;
}
.builder-step__label { font-family: var(--mono); font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.builder-step.is-active { background: var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--lime); }
.builder-step.is-active .builder-step__num { background: var(--lime); color: var(--ink); }
.builder-section { scroll-margin-top: 82px; }
@media (max-width: 1080px) {
  .builder-split { grid-template-columns: 72px minmax(0, 1fr); }
  .builder-split .preview-panel { display: none; }
}
@media (max-width: 760px) {
  .builder-split { grid-template-columns: 1fr; }
  .builder-steps { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .builder-steps::-webkit-scrollbar { display: none; }
  .builder-step { flex: 1 0 auto; flex-direction: row; gap: 0.45rem; }
}
.preview-panel { position: sticky; top: 4.75rem; }
.preview-panel__label {
  margin: 0 0 0.6rem; text-align: center; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
}
.preview-panel__label::before { content: "● "; color: var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.phone {
  border: 11px solid var(--ink); border-radius: 40px; background: var(--ink);
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255, 255, 255, 0.09);
}
.phone__screen {
  background: #fff; border-radius: 29px; padding: 2.1rem 1rem 1.5rem;
  min-height: 400px; max-height: 58vh; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  scrollbar-width: none;
}
.phone__screen::-webkit-scrollbar { display: none; }
.phone__avatar { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); }
.phone__title { font-size: 1.05rem; font-weight: 800; margin: 0.65rem 0 0.2rem; color: var(--ink); }
.phone__bio { font-size: 0.72rem; color: var(--muted); margin: 0 0 0.7rem; }
.phone__button, span.button.phone__button {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  width: 100%; min-height: 38px; margin: 0.3rem 0 0; padding: 0.45rem 0.6rem;
  border-radius: 9px; font-size: 0.78rem; font-weight: 700; cursor: default;
  transition: opacity 0.15s ease;
}
.phone__button .icon { width: 15px; height: 15px; }
.phone__url {
  display: block; width: 100%; font-size: 0.62rem; color: var(--muted);
  margin: 0.15rem 0 0.35rem; word-break: break-all;
}
.preview-dim { opacity: 0.22; }

@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .preview-panel { position: static; order: -1; max-width: 330px; margin: 0 auto 0.5rem; }
}

/* ==========================================================================
   Analytics
   ========================================================================== */

.chart { width: 100%; overflow: hidden; }
.chart__svg { width: 100%; height: 180px; display: block; }
.chart__legend {
  display: flex; align-items: center; gap: 1.25rem; margin-top: 0.75rem;
  font-size: 0.8rem; color: var(--muted); font-weight: 600;
}
.chart__range { margin-left: auto; font-weight: 500; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 0.15rem; }
.dot--primary { background: var(--primary); }
.dot--lime { background: var(--lime); }

/* Tabbed panels (e.g. analytics link/referrer/country lists) */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.tab {
  flex: 1; text-align: center;
  font-family: var(--font); font-size: 0.92rem; font-weight: 700; color: var(--ink-2);
  background: var(--surface); border: 2px solid var(--ink); border-radius: 8px;
  padding: 0.55rem 0.95rem; cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background 0.12s ease, color 0.12s ease;
}
@media (max-width: 560px) { .tabs { flex-wrap: wrap; } .tab { flex: 1 1 100%; } }
.tab:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.tab.is-active { background: var(--ink); color: #fff; box-shadow: 2px 2px 0 var(--ink); }
.tab-panel .card__sub { margin: 0 0 1.1rem; }

.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
@media (max-width: 720px) { .analytics-grid { grid-template-columns: 1fr; } }
.country-flag { font-size: 1.35rem; line-height: 1; flex-shrink: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.analytics-filters { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ---- Folders ------------------------------------------------------------ */
.folder-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.folder-form input[type=text] { flex: 1; min-width: 200px; padding: 0.6rem 0.9rem;
  border: 2px solid var(--ink); border-radius: 8px; font-family: var(--font); font-size: 0.92rem; background: #fff; }
.folder-form input[type=text]:focus { outline: none; box-shadow: var(--ring); }
.folder-color {
  appearance: none; -webkit-appearance: none; font-family: var(--font); font-weight: 700; font-size: 0.85rem;
  color: var(--ink); background: var(--surface); border: 2px solid var(--ink); border-radius: 8px;
  padding: 0.55rem 2rem 0.55rem 0.85rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2316181D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 14px;
}
.folder-dot { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--ink); flex-shrink: 0; }
.folder-dot--none { background: repeating-linear-gradient(45deg, #e5e5e5, #e5e5e5 3px, #fff 3px, #fff 6px); }

/* Folder grid — clickable cards that jump to the filtered dashboard */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.folder-card { position: relative; border: 2px solid var(--ink); border-radius: 12px; background: var(--card);
  box-shadow: 3px 4px 0 var(--ink); transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.folder-card:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--ink); }
.folder-card--muted { border-style: dashed; box-shadow: none; background: var(--fill); }
.folder-card--muted:hover { box-shadow: none; }
.folder-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem;
  padding: 1.1rem 1.15rem; text-decoration: none; }
.folder-card__body:hover { text-decoration: none; }
.folder-card__swatch { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center; }
.folder-card__glyph { color: rgba(255, 255, 255, 0.92); }
.folder-card__swatch--none { background: repeating-linear-gradient(45deg, #e5e5e5, #e5e5e5 4px, #fff 4px, #fff 8px); }
.folder-card__name { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.folder-card__tools { position: absolute; top: 0.6rem; right: 0.6rem; display: flex; gap: 0.3rem; opacity: 0; transition: opacity 0.12s ease; }
.folder-card:hover .folder-card__tools { opacity: 1; }
.folder-card__tools form { margin: 0; }
.folder-card__edit, .folder-card__del {
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--ink); color: var(--ink);
  transition: background 0.12s ease, color 0.12s ease;
}
.folder-card__edit:hover { background: var(--ink); color: #fff; }
.folder-card__del:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.folder-card__form { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1.15rem 1.1rem; }
.folder-card__form input[type=text] { padding: 0.5rem 0.7rem; border: 2px solid var(--ink); border-radius: 8px;
  font-family: var(--font); font-size: 0.9rem; font-weight: 700; background: #fff; }
.folder-card__form input[type=text]:focus { outline: none; box-shadow: var(--ring); }
.folder-tag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; color: var(--ink); }
.folder-tag .folder-dot { width: 12px; height: 12px; border-width: 1.5px; }

.bar-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0; }
.bar-row .icon-chip { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bar-row .icon-chip img { width: 17px; height: 17px; }
.bar-row__body { flex: 1; min-width: 0; }
.bar-row__top { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.3rem; }
.bar-row__name { font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row__count { font-weight: 700; font-size: 0.88rem; color: var(--ink); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ink), var(--lime)); min-width: 4px; animation: bar-grow 0.7s var(--ease) both; transform-origin: left; }
@keyframes bar-grow { from { transform: scaleX(0.3); opacity: 0.4; } to { transform: scaleX(1); opacity: 1; } }
.bar-fill--alt { background: linear-gradient(90deg, var(--ink), var(--lime)); }

/* Analytics card hover + entrance / chart line-draw micro-animations */
.analytics-grid > .card {
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.analytics-grid > .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
@media (prefers-reduced-motion: no-preference) {
  .stats .stat { animation: rise-in 0.5s var(--ease) both; }
  .stats .stat:nth-child(2) { animation-delay: 0.06s; }
  .stats .stat:nth-child(3) { animation-delay: 0.12s; }
  .stats .stat:nth-child(4) { animation-delay: 0.18s; }
  .analytics-grid > .card:nth-child(2) { animation: rise-in 0.5s var(--ease) 0.08s both; }
  .bar-row { animation: rise-in 0.45s var(--ease) both; }
  .bar-row:nth-child(3) { animation-delay: 0.05s; }
  .bar-row:nth-child(4) { animation-delay: 0.1s; }
  .bar-row:nth-child(5) { animation-delay: 0.15s; }
  .chart__line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-line 1.3s var(--ease) forwards; }
  .chart__line:nth-of-type(2) { animation-delay: 0.25s; }
  .chart__area { animation: fade-in 1.4s ease 0.3s both; }
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   Themes gallery
   ========================================================================== */

.theme-toolbar {
  display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap;
  padding: 1rem 1.25rem;
}
.theme-toolbar label { font-weight: 700; font-size: 0.85rem; color: var(--ink-2); }
.theme-toolbar select {
  padding: 0.5rem 0.8rem; border: 1px solid var(--border-strong); border-radius: 10px;
  font-family: var(--font); font-size: 0.9rem; background-color: #fff; color: var(--text); min-width: 200px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.theme-toolbar select:hover { border-color: var(--muted); }
.theme-toolbar select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.theme-toolbar .card__hint { margin-left: auto; }

.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 1100px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .theme-grid { grid-template-columns: 1fr; } }
.theme-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), border-color 0.22s var(--ease);
}
.theme-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.theme-swatch {
  padding: 1.5rem 1.25rem 1.35rem; display: flex; flex-direction: column; align-items: center;
  gap: 0.4rem; min-height: 170px;
}
.theme-swatch__avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid; opacity: 0.65;
  background: currentColor; margin-bottom: 0.15rem;
}
.theme-swatch__name { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.35rem; opacity: 0.85; }
.theme-swatch__btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; min-height: 30px; padding: 0.32rem 0.5rem; border-radius: 7px;
  font-size: 0.72rem; font-weight: 700; cursor: default;
}
.theme-swatch__btn .icon { width: 13px; height: 13px; }
.theme-card__body { padding: 1rem 1.1rem 1.15rem; }
.theme-card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.theme-card__head h3 { margin: 0; font-size: 1rem; }
.theme-card__blurb { color: var(--muted); font-size: 0.82rem; margin: 0.25rem 0 0.9rem; }
.theme-card__actions { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.theme-card__form { display: contents; }

/* ==========================================================================
   Plans & teams
   ========================================================================== */

.pricing-head { text-align: center; margin: 1.5rem 0 2.5rem; }
.pricing-head h1 { font-size: 2rem; margin: 0 0 0.4rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; align-items: stretch; }
.plan-card {
  position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem 1.75rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.plan-card--featured:hover { box-shadow: 0 24px 52px -16px rgba(22, 24, 29, 0.5); }
.plan-card--featured {
  border: 2px solid var(--primary);
  box-shadow: 0 16px 40px -16px rgba(22, 24, 29, 0.4);
}
.plan-card__flag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--violet)); color: #fff;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 999px; padding: 0.25rem 0.9rem; white-space: nowrap;
}
.plan-card h2 { margin: 0 0 0.15rem; font-size: 1.15rem; }
.plan-card__tagline { color: var(--muted); font-size: 0.85rem; margin: 0 0 1rem; }
.plan-card__price { font-size: 2.4rem; font-weight: 700; color: var(--ink); margin: 0 0 1.25rem; letter-spacing: -0.03em; }
.plan-card__price span { font-size: 0.9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-card__features { list-style: none; margin: 0 0 1.75rem; padding: 0; flex: 1; }
.plan-card__features li {
  padding: 0.45rem 0 0.45rem 1.7rem; position: relative; font-size: 0.9rem;
  border-bottom: 1px dashed var(--border);
}
.plan-card__features li:last-child { border-bottom: none; }
.plan-card__features li::before {
  content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700;
}
.plan-card .btn { width: 100%; }
.plan-card__current { cursor: default; opacity: 0.6; }
.pricing-note { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 2rem; }

.upgrade-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--ink); color: #c9cbe0; border-radius: var(--radius);
  padding: 0.9rem 1.4rem; margin-bottom: 1.5rem; font-size: 0.85rem;
  background-image: radial-gradient(400px 140px at 95% -30%, rgba(22, 24, 29, 0.5), transparent);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.upgrade-banner strong { color: #fff; display: block; }

/* ==========================================================================
   Billing dashboard
   ========================================================================== */
.bill-summary {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-sm);
  margin-bottom: 2.25rem;
}
.bill-summary__main { min-width: 0; }
.bill-summary__row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.bill-plan-badge {
  font-weight: 700; font-size: 0.95rem; color: #fff;
  border-radius: 999px; padding: 0.3rem 0.9rem;
  background: linear-gradient(135deg, var(--primary), var(--violet));
}
.bill-plan-badge--free { background: var(--ink-2); }
.bill-plan-badge--team { background: linear-gradient(135deg, var(--violet), var(--lime)); }
.bill-status {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem; border-radius: 999px;
}
.bill-status--active { color: var(--success); background: var(--success-soft); border: 1px solid var(--success-border); }
.bill-status--free { color: var(--muted); background: var(--bg); border: 1px solid var(--border); }
.bill-summary__price { font-size: 2.4rem; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -0.03em; }
.bill-summary__price span { font-size: 0.9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.bill-summary__tagline { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 1.5rem; }
.bill-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0; }
.bill-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.25rem; }
.bill-meta dd { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.bill-summary__aside { border-left: 1px solid var(--border); padding-left: 1.5rem; }
.bill-summary__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 0.75rem; }
.bill-perks { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.bill-perks li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; padding: 0.3rem 0; }
.bill-perks li svg { color: var(--success); flex-shrink: 0; }
.btn.bill-cancel { width: 100%; background: #ceccc3; color: var(--ink); }
.btn.bill-cancel:hover { background: var(--ink); color: #fff; }

.bill-section { margin-bottom: 2.5rem; }
.bill-section__head { margin-bottom: 1.25rem; }
.bill-section__head h2 { margin: 0 0 0.2rem; font-size: 1.2rem; }
.bill-section__head p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.plan-card--compact { padding: 1.5rem 1.4rem; }
.plan-card--compact h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.plan-card__price--sm { font-size: 1.7rem; margin: 0 0 1rem; }
.plan-card--current { border-color: var(--primary); background: var(--primary-soft); }
.plan-card__flag--current { background: var(--ink-2); }

.bill-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.bill-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.bill-table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 700; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border);
}
.bill-table td { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.bill-table tbody tr { transition: background 0.12s ease; }
.bill-table tbody tr:hover { background: var(--bg); }
.bill-table tbody tr:last-child td, .bill-table tbody tr:last-child td { border-bottom: none; }
.bill-table__amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bill-ref { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
.bill-kind {
  display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem; border-radius: 6px; margin-right: 0.5rem;
  color: var(--primary); background: var(--primary-soft);
}
.bill-kind--payment { color: var(--success); background: var(--success-soft); }
.bill-kind--refund { color: var(--warn); background: var(--warn-soft); }

.bill-empty {
  text-align: center; color: var(--muted); padding: 3rem 1.5rem;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface);
}
.bill-empty svg { color: var(--border-strong); margin-bottom: 0.75rem; }
.bill-empty p { margin: 0; font-size: 0.9rem; }

@media (max-width: 720px) {
  .bill-summary { grid-template-columns: 1fr; }
  .bill-summary__aside { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 1.25rem; }
  .bill-meta { grid-template-columns: 1fr 1fr; }
}

.member-row {
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap;
  padding: 0.8rem 0; border-bottom: 1px solid var(--border);
}
.member-row:last-of-type { border-bottom: none; }
.member-row__avatar { width: 36px; height: 36px; font-size: 0.9rem; border-radius: 50%; }
.member-row__who { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.member-row__who strong { font-size: 0.92rem; }
.member-row .url-pill { width: auto; flex: 1 1 200px; min-width: 160px; }
.member-row .btn { flex-shrink: 0; }
.invite-form { display: flex; gap: 0.75rem; align-items: stretch; flex-wrap: wrap; }
.invite-form .field select, .invite-form .field input { height: 100%; }

.color-field { display: flex; gap: 0.6rem; align-items: center; }
.color-field input[type=color] {
  width: 46px; height: 40px; padding: 0.2rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer;
}
.color-field input[type=text] { flex: 1; }

/* ==========================================================================
   DNS table
   ========================================================================== */

.dns-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; margin: 0.9rem 0; }
.dns-table th, .dns-table td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); }
.dns-table th {
  background: var(--bg); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); border-top: 1px solid var(--border);
}
.dns-table th:first-child { border-radius: 8px 0 0 0; }
.dns-table th:last-child { border-radius: 0 8px 0 0; }
.dns-table code { font-size: 0.8rem; word-break: break-all; background: var(--bg); padding: 0.1rem 0.4rem; border-radius: 5px; }

/* ==========================================================================
   Landing page
   ========================================================================== */

.main--landing { max-width: none; padding: 0; }

/* Hero + marquee together fill the first viewport below the nav. */
.hero-viewport {
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
.hero {
  background: var(--ink); color: #e8e9f5; overflow: hidden; position: relative;
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 3.5rem var(--edge);
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  pointer-events: none;
}
.hero::before { width: 480px; height: 480px; background: var(--primary); top: -180px; right: -80px; }
.hero::after { width: 380px; height: 380px; background: var(--primary); bottom: -200px; left: -100px; opacity: 0.35; }
.hero__inner {
  max-width: none; margin: 0; position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 640px) minmax(280px, 380px);
  justify-content: center; gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px; padding: 0.3rem 0.9rem; font-size: 0.78rem; font-weight: 700;
  color: var(--lime); margin-bottom: 1.4rem;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.06; margin: 0 0 1.1rem;
  color: #fff; font-weight: 800; letter-spacing: -0.03em;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--lime), #7ef29d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__copy p { color: #b9bdd4; font-size: 1.08rem; max-width: 480px; margin: 0 0 2rem; }
.hero .actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero .btn { padding: 0.8rem 1.6rem; font-size: 0.95rem; }
.hero .btn--outline {
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); box-shadow: none;
}
.hero .btn--outline:hover { border-color: #fff; }
.hero__note { margin-top: 1.1rem; font-size: 0.78rem; color: #8b90ab; }

.hero__phone { justify-self: center; transform: rotate(3deg); animation: float 7s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-12px); }
}
.hero__phone .phone { box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.6); border-color: #2a2d40; background: #2a2d40; }
.hero__phone .phone__screen { max-height: 470px; overflow: hidden; }

/* Brand marquee */
.marquee { background: var(--ink); padding: 0 0 1.25rem; overflow: hidden; position: relative; }
.marquee p {
  text-align: center; color: #8b90ab; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 1.4rem;
}
.marquee__track { display: flex; gap: 2.4rem; width: max-content; animation: marquee 36s linear infinite; }
.marquee__track img { width: 30px; height: 30px; opacity: 0.85; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Feature sections */
.section { max-width: 1080px; margin: 0 auto; padding: 5.5rem 1.5rem; }
.section__head { text-align: center; max-width: 660px; margin: 0 auto 3.25rem; }
.section__eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  margin: 0 0 1rem;
}
.section h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin: 0 0 0.7rem; letter-spacing: -0.02em; }
.section__head p { color: var(--muted); font-size: 1.02rem; margin: 0 auto; max-width: 520px; }

/* Feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 2rem 1.85rem; box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.feature::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--violet), var(--lime));
  opacity: 0; transition: opacity 0.22s ease;
}
.feature:hover { transform: translateY(-5px); border-color: transparent; box-shadow: 0 24px 48px -20px rgba(22, 24, 29, 0.4); }
.feature:hover::before { opacity: 1; }
.feature__icon {
  width: 54px; height: 54px; border-radius: 16px; margin-bottom: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  box-shadow: 0 8px 20px -8px rgba(22, 24, 29, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.22s var(--ease);
}
.feature:hover .feature__icon { transform: scale(1.05) rotate(-3deg); }
.feature__icon .icon-svg { color: #fff; }
.feature h3 { font-size: 1.12rem; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 0.92rem; margin: 0; line-height: 1.6; }

/* Steps flow */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps--flow { position: relative; }
.steps--flow::before {
  content: ""; position: absolute; top: 48px; left: 14%; right: 14%; height: 2px; z-index: 0;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
}
@media (max-width: 760px) { .steps--flow::before { display: none; } }
.step {
  position: relative; z-index: 1; padding: 2.25rem 1.85rem 2rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--ink), #2a2f4a); color: var(--lime);
  font-weight: 800; font-size: 1.15rem; box-shadow: 0 8px 18px -8px rgba(16, 19, 34, 0.6);
}
.step h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.step p { color: var(--muted); font-size: 0.92rem; margin: 0; line-height: 1.6; }

/* Pricing preview */
.price-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 760px) { .price-preview { grid-template-columns: 1fr; } }
.price-preview .plan-card { padding: 2rem 1.75rem; border-radius: 20px; }
.price-preview__compare { text-align: center; margin-top: 2.25rem; }
.price-preview__compare a { font-weight: 700; color: var(--primary); }

/* CTA band */
.cta-band {
  max-width: 1080px; margin: 1rem auto 5rem; padding: 4.5rem 2rem; text-align: center;
  background: linear-gradient(120deg, var(--primary) 0%, var(--violet) 65%, var(--primary) 130%);
  border-radius: 28px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(22, 24, 29, 0.55);
}
.cta-band::before, .cta-band::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.cta-band::before { width: 320px; height: 320px; background: rgba(255, 255, 255, 0.25); top: -140px; right: -60px; }
.cta-band::after { width: 260px; height: 260px; background: var(--lime); opacity: 0.25; bottom: -140px; left: -40px; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 0.6rem; letter-spacing: -0.02em; }
.cta-band p { color: #e9e4ff; margin: 0 0 2rem; font-size: 1.05rem; }
.cta-band .btn {
  background: #fff; color: var(--ink); border: none; padding: 0.9rem 1.9rem;
  font-size: 1rem; font-weight: 700; border-radius: 999px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta-band .btn:hover { background: var(--lime); transform: translateY(-2px); }

/* Footer */
.footer { background: var(--ink); color: #a6abc7; margin-top: 4rem; }
.footer a { color: #a6abc7; font-weight: 500; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer__grid {
  max-width: 1080px; margin: 0 auto; padding: 3.5rem 1.5rem 2.5rem;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem;
}
.footer__brand { max-width: 300px; }
.footer__brand .nav__brand { color: #fff; margin-bottom: 0.75rem; }
.footer__brand p { color: #8b90ab; font-size: 0.85rem; margin: 0; }
.footer__col h4 {
  color: #fff; font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin: 0 0 0.9rem;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.footer__col a, .footer__col .linklike { font-size: 0.88rem; color: #a6abc7; }
.footer__col .linklike:hover { color: #fff; }
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer__bottom-inner {
  max-width: 1080px; margin: 0 auto; padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.78rem; color: #8b90ab;
}
.footer__bottom a { color: #8b90ab; }

@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

/* Landing tucks under the floating pill nav */
.main--landing { margin-top: calc(-1 * var(--nav-h)); }
.main--landing .hero { padding-top: 6rem; }
.landing .footer { margin-top: 0; }

@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__phone { display: none; }
}

/* ==========================================================================
   Settings
   ========================================================================== */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; align-items: start; }

.settings-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.settings-nav__link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.85rem; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: 0.92rem;
  border: 1px solid transparent; transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.settings-nav__link svg { color: var(--muted); flex-shrink: 0; }
.settings-nav__link:hover { background: var(--bg); text-decoration: none; }
.settings-nav__link.is-active {
  background: var(--surface); border-color: var(--primary); color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.settings-nav__link.is-active svg { color: var(--primary); }

.settings-panel { min-width: 0; max-width: 640px; }
.settings-head { margin-bottom: 1rem; }
.settings-head h2 { margin: 0 0 0.15rem; font-size: 1.15rem; }
.settings-head h3 { margin: 0 0 0.15rem; font-size: 1rem; }
.settings-head p { margin: 0; color: var(--muted); font-size: 0.86rem; }

.settings-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.settings-card--danger { border-color: var(--danger-border); background: var(--danger-soft); }

.profile-id { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 1.2rem;
}
.profile-name { margin: 0; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.profile-email { margin: 0; color: var(--muted); font-size: 0.9rem; }

.field-hint { color: var(--muted); font-size: 0.78rem; margin: 0.4rem 0 0; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.settings-rule { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.settings-subhead { margin: 0 0 0.25rem; font-size: 1rem; }

.settings-empty { text-align: center; color: var(--muted); padding: 1.5rem 1rem; }
.settings-empty svg { color: var(--border-strong); margin-bottom: 0.75rem; }
.settings-empty__title { margin: 0 0 0.35rem; font-weight: 700; font-size: 1rem; color: var(--text); }
.settings-empty p { margin: 0 auto 1.25rem; max-width: 360px; font-size: 0.88rem; }
.settings-empty .btn { pointer-events: none; opacity: 0.6; }

@media (max-width: 720px) {
  .settings-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
}

/* ==========================================================================
   Dashboard.dc design refinements
   ========================================================================== */

/* Hover-lift / press utilities (shared with the design import) */
.lift { transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease); }
.lift:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.press:active { transform: translate(2px, 2px); }

/* Warm canvas + inkier chrome to match the import */
body { background: var(--bg); }
.sidebar { background: var(--sidebar); border-right: 3px solid var(--ink); }
.topbar { background: rgba(243, 239, 228, 0.85); border-bottom: 3px solid var(--ink); }

/* Sidebar: mono section labels, "New" pill on nav items, yellow active shadow */
.sidebar__section { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; }
.sidebar__link.is-active { box-shadow: 3px 3px 0 var(--lime); }
.sidebar__badge {
  margin-left: auto; font-family: var(--mono); font-size: 0.64rem; font-weight: 700;
  background: var(--ink); color: var(--lime); border-radius: 6px; padding: 0.05rem 0.4rem;
}
.sidebar__link.is-active .sidebar__badge { background: var(--lime); color: var(--ink); }
.shell.is-collapsed .sidebar__badge { display: none; }

/* Expand/collapse-all: icon-only toggle */
.collapse-all__expand, .collapse-all__collapse { display: inline-flex; }
.collapse-all__collapse { display: none; }
.collapse-all.is-expanded .collapse-all__expand { display: none; }
.collapse-all.is-expanded .collapse-all__collapse { display: inline-flex; }

/* Segmented status tabs (All / Live / Draft) */
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.seg__btn {
  border: none; border-right: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: 0.85rem; font-weight: 700; padding: 0.55rem 1rem; cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
.seg__btn:last-child { border-right: none; }
.seg__btn:hover:not(.is-active) { background: var(--fill); }
.seg__btn.is-active { background: var(--ink); color: #fff; }

/* Stronger card edges to match the import */
.stat, .page-card { border-width: 3px; }
.page-card { box-shadow: 4px 4px 0 var(--ink); }
.page-card:hover { box-shadow: 6px 6px 0 var(--ink); }
.featured .page-card { box-shadow: 4px 4px 0 var(--gold); }
.featured .page-card:hover { box-shadow: 6px 6px 0 var(--gold); }

/* Dashed meta divider + mono timestamps/counts on page cards */
.page-card__meta, .page-card__compact { border-top: 2px dashed #d9d2bf; padding-top: 0.85rem; }
.page-card__updated { font-family: var(--mono); font-size: 0.72rem; }
.stats + * .card__hint, .page-filters .card__hint { font-family: var(--mono); }

/* New-page creation form */
.np-card { box-shadow: 4px 4px 0 var(--ink); }
.np-step { display: flex; align-items: flex-start; gap: 0.7rem; margin-bottom: 1.25rem; }
.np-step h2 { margin: 0; font-size: 1.1rem; }
.np-step .card__sub { margin: 0.1rem 0 0; }
.np-step .step-num { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--ink);
  background: var(--lime); color: var(--ink); font-size: 0.9rem; }
.np-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.np-row .field { margin-bottom: 0.4rem; }
@media (max-width: 620px) { .np-row { grid-template-columns: 1fr; } }
.np-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.5rem; }
.np-actions__note { font-family: var(--mono); font-size: 0.75rem; margin-left: 0.25rem; }
@media (max-width: 560px) { .np-actions__note { flex: 1 1 100%; margin-left: 0; } }

/* Support page */
.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
@media (max-width: 720px) { .support-grid { grid-template-columns: 1fr; } }
.support-card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: 4px 4px 0 var(--ink);
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.support-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.support-card__icon {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 0.3rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--ink); border: 2px solid var(--ink);
}
.support-card__icon--blue { background: var(--tint-blue); }
.support-card__icon--green { background: var(--tint-green); }
.support-card__icon--yellow { background: var(--tint-yellow); }
.support-card__icon--violet { background: var(--tint-violet); }
.support-card h3 { margin: 0; font-size: 1.05rem; }
.support-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.support-card__link { margin-top: 0.35rem; font-weight: 700; color: var(--ink); }
.support-card__link .icon-svg { transform: rotate(45deg); vertical-align: -1px; }
.support-contact {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap;
  border-width: 3px; box-shadow: 4px 4px 0 var(--ink);
}
.support-contact__body { display: flex; align-items: center; gap: 0.9rem; }
.support-contact__body h2 { margin: 0 0 0.15rem; font-size: 1.15rem; }
.support-contact__icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--lime); color: var(--ink); border: 2px solid var(--ink);
}
