/* In-app styles (sidebar shell, dashboard, listing, run log, auth). Builds on brand.css (light SaaS). */

body { background: var(--bg-2); min-height: 100vh; font-size: 14px; }

h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

/* App shell: sidebar + content */
body:has(> .sidebar) { display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1rem 0.85rem; z-index: 35;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0.35rem 0.5rem 1.1rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { margin: 1.25rem 0 0.4rem; padding: 0 0.7rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.nav-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 0.9rem; font-weight: 500; transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--muted); transition: color 0.15s; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item:hover svg { color: var(--text-2); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 550; }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item .kbd { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 0 0.35rem; }
.sidebar-foot { padding-top: 0.75rem; border-top: 1px solid var(--border); }

.user-menu { position: relative; }
.user-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); transition: background 0.15s;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--bg-3); }
.user-menu .user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-menu .uname { font-size: 0.88rem; font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .uplan { font-size: 0.74rem; color: var(--muted); }
.user-menu .chev { margin-left: auto; width: 16px; height: 16px; color: var(--faint); flex: none; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--gradient); color: #fff; font-size: 0.85rem; font-weight: 650; text-transform: uppercase;
}
.user-menu .menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 0.5rem); padding: 0.4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: rise 0.2s var(--ease) both;
}
.user-menu .menu .who { padding: 0.5rem 0.65rem; font-size: 0.78rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 0.3rem; }
.user-menu .menu a { display: block; padding: 0.5rem 0.65rem; border-radius: var(--radius-xs); color: var(--text-2); font-size: 0.88rem; }
.user-menu .menu a:hover { background: var(--bg-3); color: var(--text); }

.mobile-bar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-toggle, .sidebar-close { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.sidebar-toggle svg, .sidebar-close svg { width: 20px; height: 20px; }

.page { padding: 2rem 2.5rem 4rem; max-width: 1280px; width: 100%; margin: 0 auto; min-width: 0; }

@media (max-width: 900px) {
  body:has(> .sidebar) { grid-template-columns: 1fr; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; padding: 0.6rem 1rem; background: rgba(255,255,255,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
  .sidebar-toggle, .sidebar-close { display: inline-flex; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; height: 100dvh; transform: translateX(-104%); transition: transform 0.3s var(--ease); box-shadow: var(--shadow-xl); z-index: 60; }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15,23,42,0.4); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .sidebar.open + .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .page { padding: 1.25rem 1rem 3rem; }
}

/* Page heading + breadcrumbs */
.crumbs { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs span[aria-current] { color: var(--text-2); font-weight: 500; }
.crumbs .sep { color: var(--faint); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.03em; }
.page-head .sub { margin: 0.3rem 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.page-head form { margin: 0; }
.flash { display: none; }

/* Auth */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.auth-main { position: relative; display: flex; flex-direction: column; padding: 2rem 2.5rem; }
.auth-main .logo { align-self: flex-start; }
.auth-form { width: 100%; max-width: 400px; margin: auto; padding: 2.5rem 0; animation: rise 0.5s var(--ease) both; }
.auth-form h1 { font-size: 1.9rem; margin: 0 0 0.4rem; letter-spacing: -0.035em; }
.auth-form .sub { color: var(--muted); margin: 0 0 1.75rem; }
.auth-form .btn { margin-top: 0.5rem; }
.auth-form .switch { margin: 1.5rem 0 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
.auth-form .fineprint { margin: 1rem 0 0; text-align: center; font-size: 0.78rem; color: var(--faint); }
.auth-form .fineprint a { color: var(--muted); text-decoration: underline; }
.auth-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 3.5rem;
  margin: 1rem 1rem 1rem 0; border-radius: var(--radius-xl); color: #fff;
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 45%, #4f46e5 100%);
}
.auth-side::before { content: ""; position: absolute; width: 60%; aspect-ratio: 1; right: -20%; top: -20%; border-radius: 50%; background: radial-gradient(closest-side, rgba(124,58,237,0.7), transparent); filter: blur(20px); animation: blob 14s ease-in-out infinite; }
.auth-side::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.12;
  background-image: linear-gradient(rgba(255,255,255,0.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.7) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.auth-side > * { position: relative; z-index: 1; max-width: 460px; }
.auth-side .eyebrow { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.2); }
.auth-side .eyebrow::before { background: #a5b4fc; }
.auth-side h2 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); letter-spacing: -0.035em; line-height: 1.12; margin: 1.1rem 0; color: #fff; }
.auth-side h2 .gradient-text { background: linear-gradient(100deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; }
.auth-side .muted { color: rgba(255,255,255,0.72); font-size: 1rem; }
.auth-side ul { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 0.85rem; color: rgba(255,255,255,0.85); }
.auth-side li { display: flex; gap: 0.75rem; align-items: flex-start; }
.auth-side li::before { content: "✓"; flex: none; display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.14); font-size: 0.72rem; font-weight: 700; }
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 1.5rem; }
}

/* Dashboard */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.extract-form { position: relative; display: flex; gap: 0.6rem; padding: 0.4rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.15s, box-shadow 0.15s; }
.extract-form:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.extract-form input[type="url"] { flex: 1; padding: 0.7rem 0.9rem; font-size: 0.98rem; border: 0; background: transparent; box-shadow: none; }
.extract-form input[type="url"]:focus { box-shadow: none; }
.extract-form .btn { border-radius: var(--radius-sm); }
@media (max-width: 560px) { .extract-form { flex-direction: column; } }

/* Create posts dialog */
.posts-head { align-items: center; }
.posts-head h1 { display: flex; align-items: center; gap: 0.6rem; }
.posts-head .feed-count { font-size: 0.8rem; }
.btn-icon { width: 16px; height: 16px; margin-left: -0.15rem; }
.create { width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 30px 80px -20px rgba(15,23,42,0.45); }
.create[open] { animation: rise 0.25s var(--ease) both; }
.create::backdrop { background: rgba(15,23,42,0.5); backdrop-filter: blur(3px); }
.create form { display: flex; flex-direction: column; max-height: calc(100vh - 3rem); }
.create-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem 1rem; }
.create-head h2 { margin: 0; font-size: 1.2rem; letter-spacing: -0.02em; }
.create-head p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }
.create-body { display: flex; flex-direction: column; gap: 1.35rem; padding: 0.25rem 1.5rem 1.4rem; overflow-y: auto; }
.create-field > label { display: block; margin: 0 0 0.45rem; font-size: 0.78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.create-field > label span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.create-url { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.6rem 0 0.85rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.create-url:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.create-url > svg { flex: none; width: 17px; height: 17px; color: var(--faint); }
.create-url:focus-within > svg { color: var(--accent); }
.create-url input[type="url"] { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; padding: 0.8rem 0; font-size: 1rem; }
.create-url input[type="url"]:focus { box-shadow: none; }
.create-help { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--muted); }
.create-field textarea { resize: vertical; font-size: 0.9rem; line-height: 1.5; }
.create .plan-grid { gap: 1.1rem 1.25rem; }
.create .plan-oh .field label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.create-foot { display: flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.composer-site {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.22rem 0.6rem;
  border-radius: 999px; background: var(--success-soft); border: 1px solid #a7f3d0; color: var(--success); font-size: 0.76rem; font-weight: 600;
  animation: rise 0.2s var(--ease) both;
}
.composer-site::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.composer-site.is-warn { background: var(--warning-soft); border-color: #fde68a; color: var(--warning); cursor: help; }
.composer-site[hidden] { display: none; }
.composer-hint { margin-right: auto; display: inline-flex; gap: 0.2rem; color: var(--faint); }
.composer-hint kbd { min-width: 1.4rem; padding: 0.05rem 0.35rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font-family: var(--font); font-size: 0.72rem; text-align: center; line-height: 1.4; }
@media (max-width: 640px) {
  .create-head, .create-body, .create-foot { padding-left: 1.1rem; padding-right: 1.1rem; }
  .composer-hint { display: none; }
  .create-foot .btn { flex: 1; justify-content: center; }
}

/* Property page: make posts + posts */
.make-card { padding: 1.35rem 1.5rem 1.25rem; }
.make-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.make-head p { margin: 0.25rem 0 1.1rem; }
.make-form .plan-grid { gap: 1.1rem 1.25rem; }
.make-form .plan-oh .field label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.make-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.6rem; }
.type-card { position: relative; margin: 0; cursor: pointer; font-weight: 400; }
.type-card input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.type-card-box { display: flex; flex-direction: column; gap: 0.3rem; height: 100%; padding: 0.75rem 0.85rem 0.8rem 2.4rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; position: relative; }
.type-card-box::before { content: ""; position: absolute; left: 0.85rem; top: 0.85rem; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); background: var(--surface) center / 11px no-repeat; transition: inherit; }
.type-card:hover .type-card-box { border-color: var(--border-strong); }
.type-card input:checked + .type-card-box { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.type-card input:checked + .type-card-box::before { border-color: var(--accent); background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E"); }
.type-card input:focus-visible + .type-card-box { box-shadow: var(--ring); }
.type-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.type-card-top strong { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.type-card-made { flex: none; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 0.7rem; font-weight: 600; }
.type-card-blurb { font-size: 0.8rem; line-height: 1.4; color: var(--muted); }
.prop-posts { margin-top: 1.75rem; }
.prop-posts .feed-head { gap: 0.75rem; }
.prop-posts-title { display: flex; align-items: center; gap: 0.5rem; margin: 0 auto 0 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.prop-posts .empty { margin-top: 1rem; }
.prop-posts + .layout { margin-top: 2rem; }
@media (max-width: 640px) { .make-card { padding: 1.1rem; } .make-foot .btn { width: 100%; justify-content: center; } }

/* Plan picker fields (shared by the composer and the listing page) */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 1.25rem; }
.plan-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.plan-group legend, .plan-group > label { display: block; margin: 0 0 0.45rem; font-size: 0.78rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; padding: 0; }
.plan-group > label .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.plan-span { grid-column: 1 / -1; }
.plan-hint { margin: 0.45rem 0 0; }
.picks { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pick { position: relative; margin: 0; cursor: pointer; font-weight: 500; }
.pick input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.pick span { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem 0.45rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 0.86rem; transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s; }
.pick span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); flex: none; transition: inherit; }
.pick:hover span { border-color: var(--border-strong); color: var(--text); }
.pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pick input:checked + span::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.pick input:focus-visible + span { box-shadow: var(--ring); }
.plan-oh-fields { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0 0.75rem; }
.plan-oh-current { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: -0.25rem; }
.plan-oh-current[hidden] { display: none; }
.plan-oh-current .check { margin: 0; }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; } .plan-oh-fields { grid-template-columns: 1fr; } }

.posts-head .actions .search { position: relative; }
.posts-head .actions .search svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.posts-head .actions .search input { width: 220px; padding-left: 2.1rem; font-size: 0.88rem; }
@media (max-width: 720px) { .posts-head .actions { width: 100%; } .posts-head .actions .search { flex: 1; } .posts-head .actions .search input { width: 100%; } }

.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.15rem; }
.home-card {
  display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s;
  animation: rise 0.45s var(--ease) both; animation-delay: calc(0.04s * var(--i, 0));
}
.home-card[hidden] { display: none; }
.home-card:hover { color: inherit; transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.home-photo { position: relative; aspect-ratio: 16 / 10; background: var(--bg-3) center / cover no-repeat; }
.home-card.is-loading .home-photo { background-image: linear-gradient(90deg, var(--bg-3) 25%, var(--surface-3) 50%, var(--bg-3) 75%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.home-note { position: absolute; left: 0.7rem; bottom: 0.7rem; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.25rem 0.65rem; border-radius: 999px; background: rgba(255,255,255,0.92); font-size: 0.76rem; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-xs); }
.home-body { padding: 0.9rem 1rem 0.75rem; }
.home-addr { font-weight: 600; font-size: 0.98rem; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.7rem; margin-top: 0.25rem; font-size: 0.84rem; color: var(--muted); }
.home-meta strong { color: var(--text); font-weight: 600; }
.home-posts { display: flex; align-items: center; gap: 0.6rem; margin-top: auto; padding: 0.7rem 1rem; border-top: 1px solid var(--border); background: var(--bg-2); }
.home-thumbs { display: flex; align-items: center; }
.home-thumbs img, .home-more { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; border: 2px solid var(--surface); box-shadow: var(--shadow-xs); }
.home-thumbs > * + * { margin-left: -8px; }
.home-more { display: inline-grid; place-items: center; background: var(--bg-3); color: var(--text-2); font-size: 0.7rem; font-weight: 600; }
.home-count { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-2); font-weight: 500; }
.home-go { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.home-go .arrow { display: inline-block; transition: transform 0.2s var(--ease); }
.home-card:hover .home-go .arrow { transform: translateX(3px); }

.feed { margin-top: 1.5rem; }
.feed-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.feed-count { font-size: 0.75rem; font-weight: 600; color: var(--text-2); background: var(--bg-3); border-radius: 999px; padding: 0.12rem 0.55rem; font-variant-numeric: tabular-nums; }
.feed-head .search { position: relative; }
.feed-head .search svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.feed-head .search input { width: 220px; padding-left: 2.1rem; font-size: 0.88rem; }
@media (max-width: 720px) { .feed-head .search { flex: 1 1 100%; order: 3; } .feed-head .search input { width: 100%; } }

.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; margin-top: 1.1rem; align-items: start; }
.post-tile {
  display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  transition: transform 0.25s var(--ease), border-color 0.2s, box-shadow 0.25s;
  animation: rise 0.45s var(--ease) both; animation-delay: calc(0.04s * var(--i, 0));
}
.post-tile[hidden] { display: none; }
.post-tile:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.post-tile-media { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; background: var(--bg-3); aspect-ratio: 1 / 1; }
.post-tile-media.fmt-portrait { aspect-ratio: 4 / 5; }
.post-tile-media.fmt-story { aspect-ratio: 9 / 16; }
.post-tile-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.post-tile:hover .post-tile-media img { transform: scale(1.03); }
.post-tile-media:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--accent); }
.post-tile-slides {
  position: absolute; top: 0.6rem; right: 0.6rem; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.55rem;
  font-size: 0.72rem; font-weight: 600; border-radius: 999px; background: rgba(15,23,42,0.6); color: #fff; backdrop-filter: blur(8px);
}
.post-tile-type { font-size: 0.86rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; margin-bottom: -0.35rem; }
.post-tile-slides svg { width: 12px; height: 12px; }
.post-tile-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.8rem 0.9rem 0.75rem; }
.post-tile-caption { margin: 0; font-size: 0.84rem; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.post-tile-foot { display: flex; align-items: center; gap: 0.15rem; }
.post-tile-addr { flex: 1; min-width: 0; font-size: 0.76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.post-tile-addr:hover { color: var(--text); }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.is-copied { color: var(--success); background: var(--success-soft, #dcfce7); }

.post-tile.is-making { cursor: pointer; }
.post-tile.is-making .post-tile-media {
  display: grid; place-items: center; cursor: pointer;
  background-image: linear-gradient(90deg, var(--bg-3) 25%, var(--surface-3) 50%, var(--bg-3) 75%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite;
}
.post-tile-spark { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); opacity: 0.85; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.4 6.6L21 11l-6.6 2.4L12 20l-2.4-6.6L3 11l6.6-2.4z'/%3E%3C/svg%3E") center / 60% no-repeat; animation: blink 1.4s ease-in-out infinite; }
.post-tile.is-making .post-tile-body { gap: 0.15rem; }
.post-tile.is-making strong { font-size: 0.88rem; }

.feed-empty { text-align: center; padding: 3.5rem 1rem 3.75rem; margin-top: 1.1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.feed-empty strong { display: block; font-size: 1.05rem; color: var(--text); }
.feed-empty p { margin: 0.35rem auto 0; max-width: 26rem; color: var(--muted); font-size: 0.9rem; }
.feed-empty-art { position: relative; width: 150px; height: 92px; margin: 0 auto 1.4rem; }
.feed-empty-art i { position: absolute; bottom: 0; width: 62px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.feed-empty-art i::before { content: ""; position: absolute; inset: 6px 6px 22px; border-radius: 6px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, #fff), var(--bg-3)); }
.feed-empty-art i::after { content: ""; position: absolute; left: 8px; right: 18px; bottom: 9px; height: 5px; border-radius: 3px; background: var(--bg-3); }
.feed-empty-art i:nth-child(1) { left: 0; height: 78px; transform: rotate(-8deg); }
.feed-empty-art i:nth-child(2) { left: 44px; height: 92px; z-index: 1; }
.feed-empty-art i:nth-child(3) { right: 0; height: 78px; transform: rotate(8deg); }

.viewer { width: min(1040px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 30px 80px -20px rgba(15,23,42,0.45); overflow: hidden; }
.viewer[open] { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); animation: rise 0.25s var(--ease) both; }
.viewer::backdrop { background: rgba(15,23,42,0.55); backdrop-filter: blur(3px); }
.viewer-stage { position: relative; display: grid; place-items: center; padding: 1.5rem; background: #0f172a; min-height: 0; }
.viewer-stage img { display: block; max-width: 100%; max-height: calc(100vh - 6rem); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); display: none; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.92); color: var(--text); cursor: pointer; box-shadow: var(--shadow-sm); }
.viewer-nav svg { width: 18px; height: 18px; }
.viewer-nav.is-prev { left: 0.9rem; }
.viewer-nav.is-next { right: 0.9rem; }
.viewer.is-carousel .viewer-nav { display: grid; }
.viewer-dots { position: absolute; bottom: 0.7rem; left: 0; right: 0; display: none; justify-content: center; gap: 6px; }
.viewer.is-carousel .viewer-dots { display: flex; }
.viewer-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; }
.viewer-dots button.on { background: #fff; }
.viewer-side { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.25rem 1.35rem; min-height: 0; overflow-y: auto; }
.viewer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.viewer-type { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.02em; }
.viewer-addr { font-size: 0.84rem; color: var(--muted); text-decoration: none; }
.viewer-addr:hover { color: var(--accent); }
.viewer-fmts { align-self: flex-start; }
.viewer-fmts[hidden] { display: none; }
.viewer-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0.2rem 0 -0.5rem; }
.viewer-side textarea { flex: 1; min-height: 200px; resize: none; font-size: 0.88rem; line-height: 1.55; background: var(--bg-2); }
.viewer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.viewer-actions .btn { justify-content: center; }
.viewer-actions .btn-ghost { grid-column: 1 / -1; font-size: 0.84rem; }
@media (max-width: 760px) {
  .viewer[open] { grid-template-columns: 1fr; overflow-y: auto; }
  .viewer-stage { padding: 1rem; }
  .viewer-stage img { max-height: 55vh; }
  .viewer-side textarea { min-height: 140px; }
}
.empty { text-align: center; padding: 3.5rem 1rem; margin-top: 0.5rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--muted); background: var(--surface); }
.empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 0.3rem; }

/* Listing detail */
.listing-head .status-row { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.listing-head .status-row strong { font-size: 1.05rem; color: var(--accent-text); }
.listing-head > div { min-width: 0; max-width: 100%; }
.listing-head .source { max-width: min(640px, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; margin-top: 0.3rem; color: var(--muted); font-size: 0.82rem; }
.listing-head .source:hover { color: var(--accent-text); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }
.hero { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-lg); cursor: zoom-in; display: block; background: var(--bg-3); border: 1px solid var(--border); box-shadow: var(--shadow); animation: rise 0.5s var(--ease) both; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.6rem; margin-top: 0.75rem; }
.thumb-tile { position: relative; cursor: zoom-in; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-3); aspect-ratio: 4 / 3; border: 1px solid var(--border); transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s; }
.thumb-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.thumb-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--ease); }
.thumb-tile:hover img { transform: scale(1.05); }
.thumb-tile .lbl { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.3rem 0.5rem; font-size: 0.7rem; font-weight: 500; color: #fff; background: linear-gradient(transparent, rgba(15,23,42,0.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-tile .num { position: absolute; top: 0.35rem; left: 0.35rem; font-size: 0.66rem; font-family: var(--mono); font-weight: 600; color: var(--text); background: rgba(255,255,255,0.92); padding: 0.05rem 0.4rem; border-radius: 4px; }
.details-card { margin-top: 1.5rem; }
.facts { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.facts > div { display: flex; flex-direction: column; padding: 0.6rem 0.95rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 90px; }
.facts .v { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.facts .k { font-size: 0.72rem; color: var(--muted); margin-top: 0.1rem; font-weight: 500; }
.summary-text { font-weight: 500; color: var(--text); font-size: 1.02rem; line-height: 1.6; padding-left: 0.9rem; border-left: 3px solid var(--accent-soft-2); }
.details-card h3 { margin: 1.5rem 0 0.6rem; color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.description { white-space: pre-line; line-height: 1.7; color: var(--text-2); }
.fail-card h2 { margin-top: 0; }
.fail-card { border-color: #fecaca; background: linear-gradient(180deg, var(--danger-soft), var(--surface) 40%); }
.fail-card form { margin: 1rem 0 0; }

/* Chat */
.chat { position: sticky; top: 1.25rem; display: flex; flex-direction: column; height: calc(100vh - 2.5rem); max-height: 780px; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.95rem 1.15rem; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.chat-head h2 { margin: 0; font-size: 0.98rem; }
.chat-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 0.65rem; }
.chat-empty { color: var(--muted); font-size: 0.88rem; padding: 0.75rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.msg { padding: 0.65rem 0.9rem; border-radius: 14px; max-width: 90%; line-height: 1.55; white-space: pre-wrap; word-break: break-word; font-size: 0.92rem; animation: rise 0.25s var(--ease) both; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); background: var(--surface); }
.chat-form textarea { flex: 1; resize: none; height: 2.8rem; font-size: 0.92rem; }
@media (max-width: 1100px) { .chat { position: static; height: 560px; } }

/* Run log */
.run-summary { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.run-summary > span { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 0.82rem; color: var(--text-2); }

/* Progress log (live view + run log) */
.progress-log { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; box-shadow: var(--shadow-sm); }
.progress-log .steps { list-style: none; margin: 0; padding: 0; position: relative; }
.progress-log .steps::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 2px; background: var(--border); }
.progress-log .step { position: relative; display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.5rem 0; color: var(--text-2); line-height: 1.5; animation: rise 0.3s var(--ease) both; }
.progress-log .step-icon { flex: none; width: 18px; height: 18px; margin-top: 0.15rem; border-radius: 50%; background: var(--success); position: relative; box-shadow: 0 0 0 3px var(--surface); }
.progress-log .step-icon::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.progress-log .step-text { flex: 1; }
.progress-log .step-time { flex: none; color: var(--faint); font-size: 0.76rem; font-family: var(--mono); }
.progress-log.is-live .step:last-child { color: var(--text); font-weight: 500; }
.progress-log.is-live .step:last-child .step-icon { background: var(--surface); border: 2px solid var(--border); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.progress-log.is-live .step:last-child .step-icon::after { display: none; }
.progress-log .step-error { color: var(--danger); }
.progress-log .step-error .step-icon { background: var(--danger); }
.progress-log .step-error .step-icon::after { content: "!"; border: 0; transform: none; left: 0; right: 0; top: 0; width: auto; height: auto; text-align: center; font-size: 0.72rem; font-weight: 700; line-height: 18px; color: #fff; }
.progress-log .details-toggle { margin-top: 1rem; background: none; border: 0; padding: 0; color: var(--muted); font-size: 0.82rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.progress-log .details-toggle:hover { color: var(--accent-text); }
.progress-log .tech-details { margin-top: 0.75rem; font-family: var(--mono); font-size: 0.76rem; background: #0f172a; color: #cbd5e1; border-radius: var(--radius-sm); padding: 0.85rem; max-height: 60vh; overflow-y: auto; }
.progress-log .detail summary { cursor: pointer; color: #94a3b8; padding: 0.15rem 0; }
.progress-log .detail summary:hover { color: #e2e8f0; }
.progress-log .detail-time { color: #64748b; margin-right: 0.6rem; }
.progress-log .detail pre { margin: 0.3rem 0 0.6rem; white-space: pre-wrap; word-break: break-word; color: #e2e8f0; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(15,23,42,0.88); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 50; flex-direction: column; gap: 0.75rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: var(--radius); box-shadow: var(--shadow-xl); animation: rise 0.25s var(--ease) both; }
.lightbox .caption { color: #cbd5e1; font-size: 0.9rem; }
.lightbox button { border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: #fff; cursor: pointer; border-radius: var(--radius-sm); line-height: 1; transition: background 0.15s; }
.lightbox button:hover { background: rgba(255,255,255,0.22); }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 2rem; padding: 0.35rem 0.85rem 0.5rem; }
.lightbox .prev { left: 1.5rem; } .lightbox .next { right: 1.5rem; }
.lightbox .close { position: absolute; top: 1rem; right: 1.5rem; font-size: 1.6rem; padding: 0.3rem 0.65rem 0.45rem; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--bg-3); }
.seg button { border: 0; background: none; color: var(--text-2); font: inherit; font-size: 0.82rem; font-weight: 500; padding: 0.35rem 0.85rem; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* Onboarding + brand settings */
.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; margin-bottom: 1.25rem; border-radius: var(--radius); border: 1px solid var(--accent-soft-2); background: linear-gradient(90deg, var(--accent-soft), var(--surface)); }
.setup-banner strong { font-weight: 600; }
.progress { margin: 0 0 1.5rem; }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.84rem; color: var(--muted); margin-bottom: 0.5rem; }
.progress-meta strong { color: var(--text); font-weight: 600; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: var(--pct, 33%); border-radius: inherit; background: var(--gradient); transition: width 0.5s var(--ease); }
.progress-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.6rem; font-size: 0.82rem; color: var(--faint); }
.progress-steps li { list-style: none; display: flex; align-items: center; gap: 0.4rem; }
.progress-steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.progress-steps li.done { color: var(--text-2); }
.progress-steps li.done::before { background: var(--success); }
.progress-steps li.current { color: var(--accent-text); font-weight: 550; }
.progress-steps li.current::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.progress-steps li a { color: inherit; }
.progress-steps li:nth-child(2) { justify-content: center; }
.progress-steps li:nth-child(3) { justify-content: flex-end; }

/* Brand kit: settings page and onboarding */
.bs-layout { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 1080px) { .bs-layout { grid-template-columns: 1fr; } }
.bs-form { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.bs-onboard-head { padding: 1.5rem 1.5rem 0; }
.bs-onboard-head h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.bs-onboard-head p { margin: 0; }

.bs-tabs { display: flex; gap: 0.25rem; padding: 0 1rem; border-bottom: 1px solid var(--border); }
.bs-tabs button { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.95rem 0.6rem; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 550; cursor: pointer; transition: color 0.15s; }
.bs-tabs button:hover { color: var(--text); }
.bs-tabs button[aria-selected="true"] { color: var(--text); }
.bs-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0.6rem; right: 0.6rem; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.bs-count { min-width: 1.25rem; padding: 0 0.35rem; border-radius: 999px; background: var(--bg-3); color: var(--text-2); font-size: 0.72rem; line-height: 1.25rem; text-align: center; }
.bs-tabs button[aria-selected="true"] .bs-count { background: var(--accent-soft); color: var(--accent-text); }
.bs-panel { animation: rise 0.25s var(--ease) both; }

.bs-section { padding: 1.4rem 1.5rem; }
.bs-section + .bs-section { border-top: 1px solid var(--border); }
.bs-section-head { margin-bottom: 1rem; }
.bs-section-head h3 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.bs-section-head p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.bs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.bs-grid .field { margin-bottom: 0.9rem; }
.bs-span { grid-column: 1 / -1; }
.bs-opt { margin-left: 0.25rem; color: var(--faint); font-weight: 400; font-size: 0.8rem; }
@media (max-width: 560px) { .bs-grid { grid-template-columns: 1fr; } }

.bs-palettes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.bs-palette { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s; }
.bs-palette:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.bs-palette i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,23,42,0.08); }
.bs-palette i + i { margin-left: -6px; }
.bs-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 560px) { .bs-colors { grid-template-columns: 1fr; } }
.bs-color { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); }
.bs-color input[type="color"] { flex: none; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; box-shadow: none; }
.bs-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.bs-color input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(15,23,42,0.12); }
.bs-color input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.bs-color-text { flex: 1; min-width: 0; display: grid; }
.bs-color-text label { margin: 0; font-size: 0.86rem; color: var(--text); }
.bs-color-text span { font-size: 0.76rem; color: var(--muted); }
.bs-color input.bs-hex { flex: none; width: 5.6rem; padding: 0.35rem 0.5rem; font-family: var(--mono); font-size: 0.8rem; text-transform: lowercase; }
.bs-hex.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.bs-fonts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
@media (max-width: 560px) { .bs-fonts { grid-template-columns: 1fr 1fr; } }
.bs-font { display: flex; flex-direction: column; gap: 0.1rem; margin: 0; padding: 0.8rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 400; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.bs-font:hover { border-color: var(--border-strong); }
.bs-font:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.bs-font:has(input:focus-visible), .bs-pill:has(input:focus-visible), .bs-format:has(input:focus-visible) { box-shadow: var(--ring); }
.bs-font-sample { font-size: 1.9rem; line-height: 1.1; color: var(--text); margin-bottom: 0.35rem; }
.bs-font-name { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.bs-font-pair { font-size: 0.72rem; color: var(--muted); }

.bs-uploads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
@media (max-width: 560px) { .bs-uploads { grid-template-columns: 1fr 1fr; } }
.bs-upload { display: flex; flex-direction: column; align-items: center; gap: 0.55rem; min-width: 0; padding: 1rem 0.75rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); }
.bs-upload-media {
  position: relative; display: grid; place-items: center; width: 96px; aspect-ratio: 1; margin: 0; overflow: hidden; cursor: pointer;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: repeating-conic-gradient(var(--bg-3) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bs-upload-media:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bs-upload.has-image .bs-upload-media, .bs-upload-media:has(img:not([hidden])) { border-style: solid; border-color: var(--border); }
.bs-upload-media img { width: 100%; height: 100%; object-fit: contain; padding: 0.6rem; }
.bs-upload-media.is-round img { object-fit: cover; padding: 0; }
.bs-upload-media.is-round { border-radius: 50%; }
.bs-upload-empty { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; color: var(--muted); font-size: 0.74rem; font-weight: 500; background: var(--surface); padding: 0.4rem 0.55rem; border-radius: var(--radius-sm); }
.bs-upload-empty svg { width: 20px; height: 20px; color: var(--accent); }
.bs-upload-flag { position: absolute; top: 0.4rem; left: 50%; transform: translateX(-50%); padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.bs-upload.is-removed img { opacity: 0.3; filter: grayscale(1); }
.bs-upload.is-removed .bs-upload-flag { background: var(--danger); }
.bs-upload-text { display: grid; text-align: center; }
.bs-upload-text strong { font-size: 0.86rem; font-weight: 600; }
.bs-upload-text span { font-size: 0.74rem; color: var(--muted); }
.bs-upload-actions { display: flex; justify-content: center; gap: 0.8rem; }
.bs-link { margin: 0; font-size: 0.8rem; font-weight: 550; color: var(--accent-text); cursor: pointer; }
.bs-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.bs-link.is-danger { color: var(--muted); }
.bs-link.is-danger:hover, .bs-link.is-danger:has(input:checked) { color: var(--danger); }

.bs-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.bs-pill { margin: 0; cursor: pointer; font-weight: 500; }
.bs-pill span { display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.86rem; color: var(--text-2); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.bs-pill:hover span { border-color: var(--border-strong); color: var(--text); }
.bs-pill input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }

.bs-rows { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.bs-row { display: flex; align-items: center; gap: 1rem; margin: 0; padding: 0.85rem 1rem; cursor: pointer; font-weight: 400; transition: background 0.15s; }
.bs-row + .bs-row { border-top: 1px solid var(--border); }
.bs-row:hover { background: var(--bg-2); }
.bs-row-text { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.bs-row-text strong { display: flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.bs-row-text > span { font-size: 0.8rem; color: var(--muted); }
.bs-tag { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--bg-3); color: var(--text-2); font-size: 0.7rem; font-weight: 550; }
.bs-switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 38px !important; height: 22px !important; margin: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background 0.2s; }
.bs-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,0.25); transition: transform 0.2s var(--ease); }
.bs-switch:checked { background: var(--accent); }
.bs-switch:checked::after { transform: translateX(16px); }
.bs-switch:focus-visible { outline: none; box-shadow: var(--ring); }

.bs-formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
@media (max-width: 560px) { .bs-formats { grid-template-columns: 1fr; } }
.bs-format { display: grid; justify-items: start; gap: 0.05rem; margin: 0; padding: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 400; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.bs-format:hover { border-color: var(--border-strong); }
.bs-format:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.bs-format-shape { height: 30px; margin-bottom: 0.55rem; border: 2px solid var(--border-strong); border-radius: 4px; background: var(--surface); }
.bs-format:has(input:checked) .bs-format-shape { border-color: var(--accent); background: var(--accent-soft-2); }
.bs-format strong { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.bs-format span:not(.bs-format-shape) { font-size: 0.74rem; color: var(--muted); }

.bs-savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bs-savebar .btn-ghost { margin-left: auto; }
.bs-saved, .bs-dirty { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.84rem; }
.bs-saved { color: var(--muted); }
.bs-saved svg { width: 16px; height: 16px; color: var(--success); }
.bs-dirty { color: var(--text); font-weight: 550; }
.bs-dirty i { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.bs-savebar:not(.is-dirty) .bs-dirty, .bs-savebar.is-dirty .bs-saved, .bs-savebar:not(.is-dirty) [data-discard] { display: none; }
.bs-savebar:not(.is-dirty) .btn-primary { margin-left: auto; opacity: 0.55; pointer-events: none; box-shadow: none; }
.bs-savebar.is-dirty { box-shadow: 0 -8px 24px -12px rgba(15,23,42,0.18); }

.bs-preview { position: sticky; top: 1.25rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-2); }
.bs-preview-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.bs-preview-head h2 { margin: 0; font-size: 1rem; }
.bs-preview-head p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.82rem; }
.bs-preview-head .seg { background: var(--surface); border: 1px solid var(--border); }
.bs-preview-head .seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.bs-preview-note { margin: 1rem 0 0; color: var(--faint); font-size: 0.76rem; }
.bs-preview-empty { grid-column: 1 / -1; padding: 2.5rem 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); font-size: 0.88rem; text-align: center; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.pv-card { margin: 0; animation: rise 0.3s var(--ease) both; }
.pv-card.is-off { display: none; }
.pv-frame { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-3); box-shadow: var(--shadow); }
.pv-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.pv-card figcaption { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-2); font-weight: 550; }

.form-actions { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.form-actions .btn-primary { margin-left: auto; }
.form-actions .skip { color: var(--muted); }
.form-actions .skip:hover { color: var(--text-2); }

/* Social posts on the listing page */
.posts-card { margin-bottom: 1.5rem; }
.posts-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.posts-head h2 { margin: 0; }
.posts-head p { margin: 0.25rem 0 0; }
.posts-status { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.25rem; padding: 0.85rem 1rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-soft-2); }
.posts-card > .error { margin-top: 1rem; }
.post-options { margin-top: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.post-options summary { cursor: pointer; padding: 0.75rem 1rem; font-size: 0.9rem; font-weight: 500; color: var(--text-2); list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.post-options summary::-webkit-details-marker { display: none; }
.post-options summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s; margin-right: 0.2rem; }
.post-options[open] summary::before { transform: rotate(45deg); }
.post-options summary:hover { color: var(--text); }
.post-options summary { flex-wrap: wrap; }
.post-options-title { color: var(--text); }
.post-options-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.post-options[open] .post-options-sum { white-space: normal; }
@media (max-width: 640px) { .post-options-sum { flex-basis: 100%; white-space: normal; padding-left: 1.05rem; } }
.post-options-form { padding: 0.5rem 1rem 1rem; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
.post-options-form .plan-grid { padding-top: 0.5rem; }
.post-options-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; }
.post-options-foot .btn { margin-left: auto; }
.plan-card { margin-top: 1.25rem; padding: 0; border: 0; background: transparent; box-shadow: none; }
.plan-card .post-options { margin-top: 0; background: var(--surface); }
.plan-missing { margin: 0.6rem 0 0; }
.post-fmt-tabs { margin-top: 1.5rem; }
.post-group { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.post-group:last-child { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 900px) { .post-group { grid-template-columns: 1fr; } }
.post-images h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.post-format { display: none; gap: 0.75rem; overflow-x: auto; padding: 0.25rem 0.25rem 0.5rem 0; }
.post-format.on { display: flex; }
.post-img { position: relative; flex: none; margin: 0; width: 240px; }
.post-format.fmt-story .post-img { width: 170px; }
.post-img img { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow-xs); transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.post-img:hover img { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-img .dl { position: absolute; right: 0.5rem; bottom: 0.5rem; padding: 0.3rem 0.65rem; font-size: 0.76rem; font-weight: 600; color: var(--text); background: rgba(255,255,255,0.95); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; }
.post-img:hover .dl, .post-img .dl:focus { opacity: 1; transform: none; }
.post-caption { display: flex; flex-direction: column; gap: 0.5rem; }
.post-caption label { margin: 0; }
.post-caption textarea { flex: 1; min-height: 220px; resize: vertical; font-size: 0.88rem; line-height: 1.55; }
.post-caption .btn { align-self: flex-start; }
