:root {
  --shadow: 0 8px 24px rgba(17,17,17,.065);
  --sidebar: 224px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { max-width: 100%; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--background); font: 14px/1.4 var(--font-ui); }
.environment-banner { position: fixed; top: 7px; left: 50%; z-index: 1000; padding: 5px 11px; transform: translateX(-50%); border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.18); font-size: 10px; font-weight: 850; letter-spacing: .08em; pointer-events: none; }
button,input,textarea { font: inherit; }
button,a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(30px,3.5vw,42px); line-height: 1.06; letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
h3 { margin-bottom: 4px; }
.connect-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.connect-brand img { width: 145px; height: auto; display: block; }
.connect-brand span { padding: 4px 9px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .16s ease,border-color .16s ease; }
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button:active { transform: scale(.98); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-small { min-height: 34px; padding: 0 13px; border-radius: 8px; font-size: 13px; }
.button-large { min-height: 46px; padding: 0 21px; border-radius: 10px; font-size: 15px; }
.button-wide { width: 100%; min-height: 46px; margin-top: 4px; }
.button-outline { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: none; }
.button-outline:hover { border-color: #c9c9cb; background: #f4f4f4; color: var(--ink); box-shadow: none; }
.button-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button-ghost:hover { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: none; }
.button-danger { border-color: var(--danger); background: var(--danger); }
.button-danger:hover { border-color: var(--danger-dark); background: var(--danger-dark); }
.text-link,.back-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.text-link:hover,.back-link:hover { color: var(--accent); }
.eyebrow,.platform-label { display: block; margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.notice-stack { position: fixed; z-index: 1100; top: calc(44px + env(safe-area-inset-top,0px)); left: 50%; transform: translateX(-50%); display: grid; gap: 10px; width: min(480px,calc(100% - 40px)); max-height: calc(100dvh - 100px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); overflow-y: auto; pointer-events: none; }
.notice { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 11px 12px 11px 14px; border: 1px solid transparent; border-radius: 9px; box-shadow: 0 8px 28px rgba(17,17,17,.16); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); overflow-wrap: anywhere; pointer-events: auto; }
.notice > span { min-width: 0; flex: 1; padding-top: 4px; }
.notice-close { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.notice-close:hover { background: rgba(0,0,0,.06); }
.notice-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.notice.success { border-color: #c8ecd7; background: rgba(234,248,240,.65); color: #116b3a; }
.notice.error { border-color: #ffcbd2; background: rgba(255,240,242,.65); color: var(--danger); }
.muted,.form-intro { color: var(--muted); }
.grow { min-width: 0; flex: 1; }

/* Public landing */
.public-body { min-height: 100vh; background: #fff; }
.public-header { position: sticky; top: 0; z-index: 50; display: flex; max-width: 1280px; height: 68px; align-items: center; justify-content: space-between; margin: auto; padding: 0 30px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.public-main { overflow: hidden; }
.hero { position: relative; display: grid; max-width: 1280px; min-height: 560px; grid-template-columns: minmax(0,1.03fr) minmax(420px,.97fr); gap: 38px; align-items: center; margin: auto; padding: 48px 30px 64px; }
.hero-copy { min-width: 0; }
.hero::before { display: none; }
.product-pill { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 7px 10px; border: 1px solid var(--accent-border); border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.product-pill span,.badge-live span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(88,86,214,.09); }
.hero h1 { max-width: 690px; overflow-wrap: normal; word-break: normal; font-size: clamp(44px,5vw,68px); }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-copy > p { max-width: 660px; margin-bottom: 24px; color: #56565b; font-size: 17px; line-height: 1.5; }
.hero-actions { display: flex; align-items: center; gap: 24px; }
.ecosystem { display: flex; align-items: center; gap: 7px; margin-top: 25px; color: #85858a; font-size: 12px; }
.ecosystem img { width: 25px; height: 25px; border-radius: 7px; }
.ecosystem a { font-weight: 700; }
.hero-visual { position: relative; min-height: 430px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 18px; background: var(--background); }
.orbit { display: none; }
.orbit-one { width: 480px; height: 480px; }
.orbit-two { width: 350px; height: 350px; border-style: dashed; }
.demo-card { position: relative; z-index: 2; width: min(390px,86%); padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 16px 45px rgba(17,17,17,.09); }
.demo-post { display: flex; align-items: center; gap: 13px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.demo-post small,.demo-post strong { display: block; }
.demo-post small { color: var(--muted); }
.demo-thumb { position: relative; display: grid; width: 88px; height: 88px; place-items: center; overflow: hidden; border-radius: 20px; background: var(--accent); color: #fff; }
.demo-thumb::before { position: absolute; width: 100px; height: 60px; top: -20px; left: -30px; background: rgba(255,255,255,.18); transform: rotate(-25deg); content: ""; }
.demo-thumb span { position: absolute; left: 9px; top: 7px; font-size: 10px; font-weight: 700; }
.demo-thumb svg { width: 40px; stroke: none; fill: #fff; }
.demo-flow { padding: 18px 5px 4px; }
.flow-label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.demo-flow > strong { display: inline-block; margin-top: 7px; padding: 8px 13px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.demo-flow > i { display: block; width: 1px; height: 28px; margin: 6px 0 6px 19px; background: var(--accent-border); }
.demo-message { max-width: 270px; margin-top: 8px; padding: 13px; border-radius: 15px 15px 15px 4px; background: #f1f1f2; font-weight: 650; }
.demo-message b { display: block; margin-top: 10px; padding: 8px; border-radius: 9px; background: #fff; text-align: center; }
.floating-badge { position: absolute; z-index: 3; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); font-size: 12px; font-weight: 700; }
.badge-comments { left: 12px; top: 72px; }
.badge-live { right: 12px; bottom: 66px; display: flex; align-items: center; gap: 9px; }
.badge-live span { background: var(--success); box-shadow: 0 0 0 5px rgba(22,138,74,.1); }
.capabilities { padding: 70px 30px; background: var(--background); }
.section-heading { max-width: 720px; margin: 0 auto 30px; text-align: center; }
.section-heading > span { color: var(--accent); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.section-heading h2 { margin-top: 12px; font-size: clamp(34px,5vw,53px); }
.section-heading p { color: var(--muted); font-size: 17px; }
.feature-grid { display: grid; max-width: 1120px; grid-template-columns: repeat(3,1fr); gap: 14px; margin: auto; }
.feature-grid article { min-height: 205px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.feature-grid h3 { margin-top: 20px; font-size: 19px; }
.feature-grid p { color: var(--muted); }
.feature-icon { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent); font-size: 24px; font-weight: 800; }
.feature-icon svg { width: 25px; }
.bottom-cta { display: grid; max-width: 1120px; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin: 60px auto; padding: 24px 28px; border-radius: 15px; background: var(--ink); color: #fff; }
.bottom-cta img { width: 62px; border-radius: 17px; }
.bottom-cta h2,.bottom-cta p { margin-bottom: 3px; }
.bottom-cta p { color: #bdbdc2; }
.public-footer { display: flex; max-width: 1120px; justify-content: space-between; margin: 0 auto; padding: 25px 0 40px; border-top: 1px solid var(--line); color: var(--muted); }

/* Authentication */
.login-dialog { width: min(470px,calc(100vw - 28px)); padding: 34px; border: 0; border-radius: 28px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.25); text-align: center; }
.login-dialog::backdrop { background: rgba(0,0,0,.52); backdrop-filter: blur(3px); }
.login-dialog[open] { animation: dialog-in .22s ease-out; }
.login-dialog > img { width: 175px; }
.dialog-product { display: table; margin: 3px auto 20px; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 750; }
.login-dialog h2 { font-size: 29px; }
.login-dialog > p { color: var(--muted); }
.dialog-close { position: absolute; width: 38px; height: 38px; right: 13px; top: 13px; border: 0; border-radius: 50%; background: #f2f2f2; color: #555; font-size: 25px; cursor: pointer; }
.login-form { margin-top: 18px; text-align: left; }
.login-form label,.form-card label,.field-label { display: block; margin: 13px 0; font-weight: 700; }
input:not([type="checkbox"]):not([type="hidden"]),textarea,select { display: block; width: 100%; margin-top: 5px; padding: 10px 11px; border: 1px solid #d8d8da; border-radius: 8px; outline: 0; background: #fff; color: var(--ink); resize: vertical; transition: border .15s,box-shadow .15s; }
input:focus,textarea:focus,select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,86,214,.09); }
small { display: block; color: var(--muted); font-weight: 450; }
.standalone-auth { display: grid; min-height: calc(100vh - 78px); place-items: center; align-content: center; padding: 40px 20px 80px; background: radial-gradient(circle at 20% 20%,var(--accent-soft),transparent 35%),var(--background); }
.auth-brand { margin-bottom: 22px; }
.auth-card { width: min(500px,100%); padding: 27px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 36px; }
.auth-card.in-app-card { margin: 30px auto; }
.temporary-password { margin: 22px 0; padding: 18px; border: 1px dashed var(--accent-border); border-radius: 14px; background: var(--accent-soft); font: 750 23px/1.3 ui-monospace,Consolas,monospace; letter-spacing: .06em; overflow-wrap: anywhere; }
@keyframes dialog-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }

/* Application shell */
.app-body { min-height: 100vh; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: var(--sidebar); flex-direction: column; padding: 18px 14px; border-right: 1px solid var(--line); background: #fff; }
.sidebar .connect-brand { padding: 3px 7px 19px; }
.sidebar .connect-brand img { width: 132px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 0 11px; border-radius: 8px; color: #5d5d62; font-weight: 650; text-decoration: none; }
.nav-item svg { width: 21px; }
.nav-item:hover { background: #f5f5f5; color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.signed-user { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 5px; }
.signed-user > span:last-child { min-width: 0; }
.signed-user strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.signed-avatar,.mobile-avatar { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; }
.logout-button { display: flex; width: 100%; align-items: center; gap: 11px; margin-top: 10px; padding: 10px 12px; border: 0; border-radius: 11px; background: none; color: var(--muted); cursor: pointer; }
.logout-button:hover { background: #f5f5f5; color: var(--accent); }
.logout-button svg { width: 19px; }
.app-main { min-height: 100vh; margin-left: var(--sidebar); }
.content-wrap { max-width: 1560px; margin: auto; padding: 30px 28px 52px; }
.mobile-header,.mobile-nav { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head h1 { margin-bottom: 5px; }
.page-head p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.head-mark { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 14px; background: var(--accent-soft); }
.head-mark img { width: 50px; border-radius: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 15px; color: var(--muted); }
.back-link span { font-size: 20px; }

/* Accounts */
.account-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.account-card { display: block; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: inherit; text-decoration: none; transition: border .16s,box-shadow .16s; }
.account-card:hover { border-color: #c7c7c5; box-shadow: var(--shadow); }
.account-main { display: flex; align-items: center; gap: 14px; }
.instagram-avatar { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px; font-weight: 850; box-shadow: 0 0 0 2px var(--accent); }
.instagram-avatar.large { width: 58px; height: 58px; font-size: 22px; }
.instagram-avatar.small { width: 34px; height: 34px; font-size: 13px; box-shadow: 0 0 0 1px var(--accent); }
.account-card h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.account-card p { margin: 2px 0 0; color: var(--muted); }
.card-chevron { width: 22px; color: #aaa; }
.account-metrics { display: grid; grid-template-columns: 1fr 1fr; margin: 15px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--background); }
.account-metrics div { padding: 10px 12px; }
.account-metrics div + div { border-left: 1px solid var(--line); }
.account-metrics strong,.account-metrics span { display: block; }
.account-metrics strong { font-size: 23px; line-height: 1.1; }
.account-metrics span { color: var(--muted); font-size: 12px; }
.connection-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: #c8c8cb; }
.status-dot:first-child { margin-left: 0; }
.status-dot.ok { background: var(--success); }
.empty-state { padding: 48px 22px; border: 1px dashed #d4d4d6; border-radius: 14px; background: #fff; text-align: center; }
.empty-state p { margin: auto; color: var(--muted); }
.empty-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 18px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); font-size: 30px; }

/* Media catalog */
.account-hero { display: grid; min-width: 0; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.account-title { display: flex; min-width: 0; align-items: center; gap: 13px; }
.account-title h1 { margin: 0; font-size: 26px; overflow-wrap: anywhere; }
.account-title p { margin: 3px 0 0; color: var(--muted); }
.account-summary { display: flex; min-width: 0; border-left: 1px solid var(--line); }
.account-summary div { min-width: 76px; padding: 2px 12px; text-align: center; }
.account-summary strong,.account-summary span { display: block; }
.account-summary strong { font-size: 21px; }
.account-summary span { color: var(--muted); font-size: 11px; }
.sync-form { min-width: 0; text-align: right; }
.sync-form .button + .button { margin-left: 7px; }
.sync-form small { margin-top: 7px; font-size: 11px; }
.sync-button svg { width: 19px; }
.catalog-tools { min-width: 0; margin-bottom: 13px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.catalog-search { position: relative; display: flex; min-width: 0; align-items: center; gap: 9px; }
.catalog-search > svg { position: absolute; left: 13px; width: 19px; color: var(--muted); }
.catalog-search input { height: 38px; margin: 0!important; padding-left: 40px!important; }
.catalog-search > a { padding: 0 8px; color: var(--muted); font-size: 13px; }
.filter-tabs { display: flex; max-width: 100%; gap: 6px; margin-top: 9px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs a { display: inline-flex; min-height: 32px; flex: 0 0 auto; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: #555; font-size: 12px; font-weight: 650; text-decoration: none; }
.filter-tabs a.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.filter-tabs span { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 999px; background: rgba(128,128,128,.14); font-size: 10px; }
.media-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 11px; }
.media-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; transition: border-color .16s,box-shadow .16s; }
.media-card.is-enabled { border-color: var(--accent-border); background: var(--accent-surface); }
.media-card.is-disabled { border-color: #dfe0e3; background: #f1f2f4; }
.media-card.is-unconfigured { background: #fff; }
.media-card.is-enabled .media-card-body,.media-card.is-disabled .media-card-body { background: inherit; }
.media-card:hover { border-color: #c8c8c6; box-shadow: 0 7px 20px rgba(17,17,17,.07); }
.media-preview { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--line); color: inherit; text-decoration: none; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.media-card:hover .media-preview img { transform: scale(1.025); }
.no-preview { display: grid; width: 100%; height: 100%; place-items: center; background: linear-gradient(145deg,#f5f5f5,#e8e8e8); color: var(--muted); }
.media-type { position: absolute; left: 7px; top: 7px; padding: 4px 6px; border-radius: 5px; background: rgba(17,17,17,.74); color: #fff; font-size: 8px; font-weight: 750; letter-spacing: .07em; }
.media-card-body { padding: 10px; }
.media-meta { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; }
.media-meta time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.rule-status { display: inline-flex; min-width: 0; min-height: 22px; align-items: center; gap: 5px; padding: 0 7px; border-radius: 6px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.rule-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rule-status.enabled { background: var(--success-soft); color: var(--success); }
.rule-status.disabled { background: #fff4e5; color: var(--warning); }
.rule-status.empty { background: #f1f1f2; color: var(--muted); }
.media-card-body > p { display: -webkit-box; min-height: 32px; margin: 8px 0; overflow: hidden; color: var(--ink); font-size: 11px; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.keyword-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 750; overflow-wrap: anywhere; }
.keyword-chip span { color: var(--accent-dark); font-size: 9px; text-transform: uppercase; }
.media-card-tags { display: flex; min-width: 0; align-items: center; gap: 5px; }
.follow-badge { flex: 0 0 auto; padding: 5px 7px; border-radius: 5px; background: #171717; color: #fff; font-size: 9px; font-weight: 750; }
.media-actions { display: flex; align-items: center; gap: 5px; margin-top: 9px; }
.media-actions .button { min-width: 0; min-height: 32px; flex: 1; padding: 0 8px; border-radius: 6px; font-size: 10px; }
.media-actions .statistics-button { width: 32px; flex: 0 0 32px; padding: 0; }
.media-actions .statistics-button span { display: none; }
.statistics-button svg { width: 14px; }
.icon-link { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); text-decoration: none; }
.pagination { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 20px; }
.pagination a { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; text-decoration: none; }
.pagination a.current { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Automation editor */
.automation-page-form { min-width: 0; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.editor-heading h1 { font-size: 34px; }
.editor-heading p { color: var(--muted); }
.editor-status-control { display: grid; min-width: 270px; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid var(--accent-border); border-radius: 11px; background: var(--accent-soft); }
.editor-status-control strong,.editor-status-control small { display: block; }
.editor-status-control strong { font-size: 13px; }
.editor-status-control small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.editor-layout { display: grid; grid-template-columns: minmax(240px,310px) minmax(0,1fr); gap: 16px; align-items: start; }
.post-panel { position: sticky; top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.post-preview { aspect-ratio: 1; overflow: hidden; background: var(--line); }
.post-preview img { width: 100%; height: 100%; object-fit: cover; }
.post-panel-copy { padding: 13px; }
.post-panel-copy p { max-height: 140px; overflow: auto; color: var(--ink); }
.post-data { display: flex; gap: 6px; margin: 9px 0; }
.post-data span { padding: 5px 8px; border-radius: 8px; background: #f3f3f3; color: var(--muted); font-size: 10px; }
.automation-editor { min-width: 0; }
.editor-section { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; margin-bottom: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.section-number { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.section-content { min-width: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-title h2 { margin-bottom: 3px; }
.section-title p,.builder-head p { margin: 0; color: var(--muted); font-size: 13px; }
.section-hint { margin: 10px 0; padding: 9px 10px; border-left: 3px solid var(--accent-border); border-radius: 0 7px 7px 0; background: var(--accent-soft); color: #5f5557; font-size: 12px; line-height: 1.45; }
.field-label { color: #343438; font-size: 13px; }
.field-label small { margin-top: 6px; }
.optional { color: var(--muted); font-weight: 450; }
.char-counter { float: right; color: var(--muted); font-size: 11px; font-weight: 500; }
.char-counter.over { color: var(--danger); font-weight: 750; }
.switch { position: relative; display: inline-block!important; width: 48px; height: 28px; flex: 0 0 auto; margin: 0!important; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d5d5d8; cursor: pointer; transition: .2s; }
.switch span::after { position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); content: ""; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(88,86,214,.16); }
.toggle-content { margin-top: 10px; }
.toggle-content[hidden],.toggle-content.is-disabled { display: none; }
.channel-section { transition: border-color .15s,background .15s; }
.channel-section:has(.section-title input:checked) { border-color: var(--accent-border); }
.public-reply-section { background: #fff; }
.crop-dialog { width: min(960px,calc(100vw - 32px)); max-width: none; height: min(960px,calc(100dvh - 32px)); max-height: none; padding: 0; border: 0; border-radius: 24px; overflow: hidden; color: var(--text,#222); }
.crop-dialog[open] { display: flex; flex-direction: column; }
.crop-dialog::backdrop { background: rgba(12,12,18,.7); backdrop-filter: blur(4px); }
.crop-header { position: relative; padding: 18px 56px 10px 22px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.crop-header h2 { margin: 0; font-size: 22px; }
.crop-header p { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; max-height: 42px; overflow: auto; }
.crop-body { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 12px 20px; }
.crop-workspace { flex: 1; min-height: 0; overflow: auto; display: flex; background: #19191e; border-radius: 14px; overscroll-behavior: contain; touch-action: none; }
.crop-image-plane { position: relative; margin: auto; flex: none; overflow: hidden; background: white; }
.crop-image-plane>img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.crop-selection { position: absolute; border: 2px solid white; box-shadow: 0 0 0 20000px rgba(0,0,0,.58); cursor: move; touch-action: none; box-sizing: border-box; }
.crop-selection:focus-visible { outline: 3px solid var(--accent-border); outline-offset: -5px; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,transparent 33%,#ffffff55 33%,#ffffff55 33.3%,transparent 33.3%,transparent 66%,#ffffff55 66%,#ffffff55 66.3%,transparent 66.3%),linear-gradient(transparent 33%,#ffffff55 33%,#ffffff55 33.3%,transparent 33.3%,transparent 66%,#ffffff55 66%,#ffffff55 66.3%,transparent 66.3%); }
.crop-handle { position: absolute; width: 22px; height: 22px; z-index: 1; }
.crop-handle::after { content: ''; position: absolute; width: 9px; height: 9px; background: white; border-radius: 2px; top: 6px; left: 6px; box-shadow: 0 1px 4px var(--ink); }
.crop-handle-nw { top: -9px; left: -9px; cursor: nwse-resize; }.crop-handle-ne { top: -9px; right: -9px; cursor: nesw-resize; }.crop-handle-sw { bottom: -9px; left: -9px; cursor: nesw-resize; }.crop-handle-se { bottom: -9px; right: -9px; cursor: nwse-resize; }
.crop-handle-n { top: -9px; left: calc(50% - 11px); cursor: ns-resize; }.crop-handle-s { bottom: -9px; left: calc(50% - 11px); cursor: ns-resize; }.crop-handle-e { right: -9px; top: calc(50% - 11px); cursor: ew-resize; }.crop-handle-w { left: -9px; top: calc(50% - 11px); cursor: ew-resize; }
.crop-navigation [data-crop-dots] button { border: 1px solid var(--line); border-radius: 10px; background: white; min-height: 38px; padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.crop-navigation button[aria-current=true] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.crop-note { flex: 0 0 auto; font-size: 11px; color: var(--muted); margin: 7px 0; overflow-wrap: anywhere; }
.crop-navigation { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }.crop-navigation [data-crop-dots] { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.crop-navigation[hidden] { display: none; }
.crop-footer { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: white; }
.crop-error,.crop-loading { flex: 0 0 auto; max-height: 25%; overflow: auto; padding: 10px; font-size: 13px; border-radius: 10px; overflow-wrap: anywhere; }.crop-error { color: var(--danger); background: #fff0f3; }.crop-loading { background: #f4f4f7; }
.crop-dialog button:focus-visible { outline: 3px solid var(--accent-border); outline-offset: 2px; }
.publication-crop-button { padding: 5px 0; min-height: 36px; font-size: 12px; }
@media(max-width:520px) { .crop-dialog { width: 100%; height: 100dvh; margin: 0; border-radius: 0; }.crop-body { padding: 10px 12px; }.crop-header { padding-left: 14px; }.crop-footer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom,0px)); }.crop-footer .button { flex: 1; padding-left: 8px; padding-right: 8px; font-size: 13px; } }
.public-reply-list { display: grid; gap: 14px; margin: 14px 0; }
.public-reply-row { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.public-reply-row .field-label { flex: 1; min-width: 0; margin: 0; }
.public-reply-heading { display: flex; justify-content: space-between; gap: 10px; }
.public-reply-tools { display: flex; align-items: center; gap: 6px; }
.public-reply-tools .button { min-height: 40px; padding: 8px; font-size: 12px; }
[data-reply-count] { margin-left: 8px; font-size: 12px; }
.follow-gate-section { background: linear-gradient(135deg,#fff 0%,var(--accent-soft) 100%); }
.follow-gate-section.is-unavailable { background: var(--background); }
.follow-gate-section.is-unavailable .section-title p { color: #aaa; }
.follow-gate-section.is-unavailable .switch { opacity: .55; }
.direct-section.is-unavailable { background: var(--background); }
.direct-section.is-unavailable .section-title p { color: #aaa; }
.direct-section.is-unavailable .switch { opacity: .55; }
.direct-section .follow-gate-section { display: block; margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.photo-code-choice { min-width: 0; border: 0; padding: 0; margin: 20px 0 0; }
.photo-table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.photo-user-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 20px; }
.photo-user-filter input { flex: 0 1 360px; min-width: 0; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 9px; }
.photo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.photo-table th,.photo-table td { padding: 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); white-space: nowrap; }
.photo-table th { background: var(--background); font-weight: 600; }
.photo-table tr:last-child td { border-bottom: 0; }
.wallet-inline { margin: 0; width: 190px; }
.wallet-controls { display: flex; align-items: center; gap: 6px; }
.wallet-controls input { width: 90px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.wallet-actions { display: flex; gap: 4px; }
.wallet-actions[hidden] { display: none; }
.wallet-actions button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 20px; cursor: pointer; }
.wallet-actions button[type=submit] { color: #14733a; }
.wallet-error { display: block; margin-top: 5px; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
.wallet-controls :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-code-choice legend { font-weight: 600; margin-bottom: 10px; }
.photo-code-modes { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; }
.photo-code-modes .switch { flex-shrink: 0; }
@media(max-width:600px) {
  .public-reply-row { flex-wrap: wrap; }
  .public-reply-row .field-label { flex-basis: 100%; }
  .public-reply-tools { margin-left: auto; }
}
.photo-code-input { display: flex; gap: 8px; }
.photo-code-input input { min-width: 0; flex: 1; }
.photo-code-input input[readonly] { background: #f5f5f5; color: var(--muted); }
.follow-flow { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.follow-flow span { padding: 6px 9px; border: 1px solid var(--accent-border); border-radius: 7px; background: #fff; color: #3a3032; font-size: 11px; font-weight: 750; }
.follow-flow i { color: var(--accent); font-style: normal; font-weight: 800; }
.field-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.scenario-description { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 0; }
.scenario-description p { margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 11px; line-height: 1.42; }
.scenario-description b { color: var(--ink); }
.follow-fields-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(180px,.6fr); column-gap: 12px; align-items: end; }
.follow-fields-grid .field-label { margin-top: 10px; }
.buttons-builder { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.builder-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.builder-head h3 { margin: 0; }
.button-list { display: grid; gap: 7px; margin-top: 10px; }
.button-row { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--background); }
.button-row.is-hidden { display: none; }
.button-row-head { display: flex; align-items: center; justify-content: space-between; }
.button-row-head strong { font-size: 12px; }
.row-control { width: 29px; height: 29px; padding: 0; border: 0; border-radius: 8px; background: var(--line); color: #555; cursor: pointer; }
.row-control:hover { background: var(--line); }
.row-control.remove { color: var(--danger); }
.row-control:disabled { opacity: .3; cursor: default; }
.button-fields { display: grid; grid-template-columns: .8fr 1.2fr; gap: 11px; }
.button-fields .field-label { margin: 12px 0 0; }
.editor-actions { position: sticky; bottom: 10px; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 9px; border: 1px solid rgba(0,0,0,.07); border-radius: 10px; background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(0,0,0,.1); backdrop-filter: blur(10px); }
.disable-form { margin-top: 16px; text-align: right; }
.danger-link { padding: 8px; border: 0; background: none; color: var(--danger); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.delete-rule-button { border-color: #f0c7cd; background: var(--danger-soft); color: var(--danger); cursor: pointer; }
.delete-rule-button svg { width: 14px; }
.delete-rule-button:hover { border-color: #eaa1ac; background: #ffecef; }
.confirm-dialog { width: min(440px,calc(100vw - 28px)); padding: 25px; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.25); text-align: left; }
.confirm-dialog::backdrop { background: rgba(0,0,0,.52); backdrop-filter: blur(3px); }
.confirm-dialog[open] { animation: dialog-in .18s ease-out; }
.confirm-dialog h2 { margin: 12px 42px 7px 0; font-size: 25px; }
.confirm-dialog > p { margin-bottom: 15px; color: var(--muted); }
.confirm-dialog-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: var(--success-soft); color: var(--success); font-size: 19px; font-weight: 850; }
.confirm-dialog-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-dialog-actions { display: grid; gap: 7px; margin-top: 18px; }
.confirm-dialog-actions .button { width: 100%; }
.delete-rule-caption { padding: 9px 10px; border-radius: 8px; background: var(--background); color: var(--ink)!important; font-size: 12px; }

/* Statistics */
.statistics-head { align-items: flex-end; }
.period-form { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.period-form label { min-width: 135px; color: var(--muted); font-size: 11px; font-weight: 700; }
.period-form select { height: 40px; margin-top: 4px; padding: 7px 34px 7px 10px; }
.statistics-account-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.statistics-account-card { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.statistics-card-head { display: flex; align-items: center; gap: 14px; }
.statistics-card-head h2 { margin: 0; overflow-wrap: anywhere; }
.statistics-card-head p { margin: 2px 0 0; color: var(--muted); }
.statistics-account-card > .button { width: 100%; }
.statistics-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: 15px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.statistics-metrics.has-followers { grid-template-columns: repeat(4,1fr); }
.statistics-metrics > div { min-width: 0; padding: 12px; background: var(--background); }
.statistics-metrics span,.statistics-metrics strong,.statistics-metrics small { display: block; }
.statistics-metrics span { color: var(--muted); font-size: 11px; font-weight: 650; }
.statistics-metrics strong { margin: 4px 0 2px; font-size: 25px; line-height: 1; }
.statistics-metrics-large { max-width: 760px; margin: 0 0 20px; }
.statistics-note { margin: 20px 0 0; color: var(--muted); font-size: 12px; }
.chart-card { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.chart-card-head,.section-heading-left { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.chart-card-head h2,.chart-card-head p { margin-bottom: 2px; }
.chart-card-head p { color: var(--muted); font-size: 12px; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; }
.comment-color,.comment-bar { background: var(--accent); }
.direct-color,.direct-bar { background: #222; }
.chart-scroll { margin-top: 15px; overflow-x: auto; scrollbar-color: #d1d1d3 transparent; }
.timeline-chart { display: flex; min-width: 100%; height: 205px; align-items: flex-end; gap: 5px; padding: 8px 2px 0; border-bottom: 1px solid var(--line); }
.timeline-chart.hour .chart-group { min-width: 25px; }
.timeline-chart.day .chart-group { min-width: 28px; }
.chart-group { display: flex; height: 100%; flex: 1 0 auto; flex-direction: column; justify-content: flex-end; }
.chart-bars { display: flex; height: 180px; align-items: flex-end; justify-content: center; gap: 2px; }
.chart-bars i { display: block; width: 7px; min-height: 0; border-radius: 4px 4px 0 0; }
.chart-group > span { height: 30px; padding-top: 7px; color: var(--muted); font-size: 9px; text-align: center; white-space: nowrap; transform: rotate(-35deg); }
.automation-statistics-section { margin-top: 20px; }
.section-heading-left { margin-bottom: 10px; }
.section-heading-left h2 { margin: 0; }
.automation-stat-list { display: grid; gap: 10px; }
.automation-stat-row { display: grid; grid-template-columns: 54px minmax(150px,1fr) repeat(4,68px) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.automation-stat-preview { display: grid; width: 62px; height: 62px; place-items: center; overflow: hidden; border-radius: 13px; background: var(--line); color: var(--muted); font-size: 9px; }
.automation-stat-preview img { width: 100%; height: 100%; object-fit: cover; }
.automation-stat-row p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.row-stat { text-align: center; }
.row-stat strong,.row-stat span { display: block; }
.row-stat strong { font-size: 22px; }
.row-stat span { color: var(--muted); font-size: 9px; }
.row-stat.gained strong { color: var(--accent); }
.empty-state.compact { padding: 38px 20px; }
.statistics-dialog { width: min(790px,calc(100vw - 28px)); max-height: min(820px,calc(100vh - 28px)); padding: 22px; overflow: auto; border: 0; border-radius: 15px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.statistics-dialog::backdrop { background: rgba(0,0,0,.52); backdrop-filter: blur(3px); }
.statistics-dialog[open] { animation: dialog-in .22s ease-out; }
.statistics-dialog h2 { max-width: 650px; margin-right: 35px; font-size: 27px; }
.modal-keyword { display: inline-flex; padding: 6px 10px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 750; }
.modal-stat-controls { display: flex; gap: 10px; margin-top: 18px; }
.modal-stat-controls label { min-width: 140px; color: var(--muted); font-size: 11px; font-weight: 700; }
.modal-stat-controls select { margin-top: 4px; padding: 8px 10px; }
.modal-metrics { margin: 18px 0; }
.follow-funnel { margin: 0 0 16px; padding: 13px; border: 1px solid var(--accent-border); border-radius: 10px; background: var(--accent-soft); }
.follow-funnel[hidden] { display: none; }
.funnel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.funnel-title strong { font-size: 13px; }
.funnel-title span { color: var(--muted); font-size: 10px; }
.follow-funnel-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.follow-funnel-grid > div { min-width: 0; padding: 9px; background: #fff; }
.follow-funnel-grid span,.follow-funnel-grid strong { display: block; }
.follow-funnel-grid span { color: var(--muted); font-size: 9px; }
.follow-funnel-grid strong { margin-top: 3px; font-size: 20px; }
.follow-funnel-grid .gained-followers { background: var(--accent-soft); }
.follow-funnel-grid .gained-followers strong { color: var(--accent); }
.account-follow-funnel { max-width: 900px; margin-bottom: 20px; }
.modal-chart { min-height: 190px; overflow-x: auto; padding: 13px 4px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--background); }
.modal-chart-plot { display: flex; height: 165px; align-items: flex-end; gap: 4px; }
.modal-chart-group { display: flex; min-width: 24px; height: 100%; flex: 1; flex-direction: column; justify-content: flex-end; }
.modal-chart-bars { display: flex; height: 130px; align-items: flex-end; justify-content: center; gap: 2px; }
.modal-chart-bars i { display: block; width: 7px; border-radius: 4px 4px 0 0; }
.modal-chart-group > span { height: 26px; padding-top: 5px; color: var(--muted); font-size: 8px; text-align: center; white-space: nowrap; }
.modal-loading { display: grid; min-height: 160px; place-items: center; color: var(--muted); }
.error-text { color: var(--danger); }

/* User management */
.form-card { max-width: 780px; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.access-card { margin: 0 auto; }
.form-card fieldset { margin: 15px 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.form-card legend { padding: 0 7px; font-weight: 750; }
.check { display: flex!important; align-items: center; gap: 10px; }
.check input { width: 19px; height: 19px; accent-color: var(--accent); }
.account-check { margin: 0!important; padding: 10px; border-radius: 11px; }
.account-check:hover { background: #f7f7f7; }
.user-list { display: grid; gap: 8px; }
.user-card { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.user-card h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.user-card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.large-avatar { width: 45px; height: 45px; }

@media (max-width:1600px) {
  .media-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .account-grid,.statistics-account-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:1320px) {
  .media-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width:1240px) {
  .media-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .account-hero { grid-template-columns: 1fr auto; }
  .account-summary { order: 3; grid-column: 1/-1; justify-content: center; border-top: 1px solid var(--line); border-left: 0; padding-top: 16px; }
  .automation-stat-row { grid-template-columns: 62px minmax(150px,1fr) repeat(4,62px); }
  .automation-stat-row > .button { grid-column: 2/-1; justify-self: end; }
}
@media (max-width:780px) {
  :root { --sidebar: 0px; }
  .notice-stack { top: calc(76px + env(safe-area-inset-top,0px)); width: calc(100% - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)); max-height: calc(100dvh - 164px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); }
  h1 { font-size: 32px; }
  .sidebar { display: none; }
  .app-main { margin-left: 0; padding-top: 65px; padding-bottom: calc(72px + env(safe-area-inset-bottom,0px)); }
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; height: calc(64px + env(safe-area-inset-top,0px)); align-items: flex-end; justify-content: space-between; padding: env(safe-area-inset-top,0px) 16px 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); }
  .mobile-header .connect-brand img { width: 119px; }
  .mobile-header .connect-brand span { font-size: 10px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); align-items: start; min-height: calc(66px + env(safe-area-inset-bottom,0px)); padding: 7px max(4px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(4px,env(safe-area-inset-left,0px)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(17px); }
  .mobile-nav form { min-width: 0; flex: 1; margin: 0; }
  .mobile-nav a,.mobile-nav button { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: center; gap: 2px; padding: 4px 3px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 650; text-decoration: none; }
  .mobile-nav form button { width: 100%; }
  .mobile-nav span { width: 100%; min-width: 0; text-align: center; overflow-wrap: anywhere; line-height: 1.1; }
  .mobile-nav a.active { color: var(--accent); }
  .mobile-nav svg { width: 23px; height: 23px; }
  .content-wrap { padding: 20px 14px 30px; }
  .public-header { height: 66px; padding: 0 17px; }
  .public-header .connect-brand img { width: 122px; }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 20px; padding: 55px 20px 70px; }
  .hero h1 { font-size: clamp(43px,12vw,66px); }
  .hero-copy > p { font-size: 17px; }
  .hero-visual { min-height: 470px; }
  .badge-comments { left: 2px; }
  .badge-live { right: 3px; }
  .feature-grid { grid-template-columns: 1fr; }
  .capabilities { padding: 72px 20px; }
  .bottom-cta { grid-template-columns: auto 1fr; margin: 60px 20px; padding: 25px; }
  .bottom-cta .button { grid-column: 1/-1; width: 100%; }
  .public-footer { margin: 0 20px; }
  .account-grid { grid-template-columns: 1fr; }
  .head-mark { display: none; }
  .account-hero { grid-template-columns: 1fr; gap: 20px; }
  .sync-form { text-align: left; }
  .sync-form .button { width: 100%; }
  .sync-form .button + .button { margin: 8px 0 0; }
  .account-summary { order: initial; grid-column: auto; }
  .catalog-search { flex-wrap: wrap; }
  .catalog-search input { flex: 1 1 calc(100% - 50px); }
  .catalog-search .button { flex: 0 0 auto; }
  .media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .editor-heading { align-items: flex-start; flex-direction: column; }
  .editor-status-control { width: 100%; min-width: 0; }
  .editor-layout { grid-template-columns: 1fr; }
  .post-panel { position: static; display: grid; grid-template-columns: 130px 1fr; }
  .post-preview { aspect-ratio: 1; }
  .post-panel-copy p { max-height: 70px; font-size: 12px; }
  .editor-actions { bottom: calc(73px + env(safe-area-inset-bottom,0px)); }
  .user-card { align-items: flex-start; flex-wrap: wrap; }
  .user-card .grow { flex-basis: calc(100% - 65px); }
  .page-head { align-items: flex-start; flex-direction: column; }
  .statistics-head { align-items: stretch; }
  .period-form { width: 100%; flex-wrap: wrap; }
  .period-form label { min-width: 120px; flex: 1; }
  .statistics-account-grid { grid-template-columns: 1fr; }
  .automation-stat-row { grid-template-columns: 52px minmax(0,1fr) repeat(4,54px); gap: 9px; }
  .automation-stat-preview { width: 52px; height: 52px; }
}
@media (max-width:520px) {
  .connect-brand { gap: 6px; }
  .connect-brand span { padding: 3px 7px; }
  .hero h1 { font-size: clamp(38px,10.5vw,44px); }
  .hero-actions { align-items: stretch; flex-direction: column; gap: 15px; }
  .hero-actions .button { width: 100%; }
  .hero-visual { min-height: 400px; }
  .orbit-one { width: 370px; height: 370px; }
  .orbit-two { width: 270px; height: 270px; }
  .demo-card { width: 88%; padding: 13px; }
  .floating-badge { padding: 9px 11px; font-size: 11px; }
  .badge-comments { top: 45px; }
  .badge-live { bottom: 38px; }
  .bottom-cta { grid-template-columns: 1fr; text-align: center; }
  .bottom-cta img { margin: auto; }
  .public-footer { align-items: center; flex-direction: column; gap: 7px; }
  .login-dialog { padding: 31px 20px 23px; }
  .auth-card { padding: 26px 20px; }
  .account-card { padding: 18px; }
  .account-title { align-items: flex-start; }
  .account-title h1 { font-size: 25px; }
  .account-summary div { min-width: 0; flex: 1; padding: 4px 7px; }
  .account-summary strong { font-size: 20px; }
  .media-grid { grid-template-columns: 1fr; }
  .media-actions { flex-wrap: wrap; }
  .media-actions .statistics-button { flex: 1; }
  .post-panel { display: block; }
  .post-preview { aspect-ratio: 1.3; }
  .editor-section { grid-template-columns: 1fr; padding: 14px; }
  .follow-fields-grid { grid-template-columns: 1fr; }
  .scenario-description { grid-template-columns: 1fr; }
  .follow-flow { gap: 5px; overflow-x: auto; }
  .follow-flow span { white-space: nowrap; }
  .follow-policy-note { display: block; }
  .follow-policy-note strong,.follow-policy-note span { display: block; }
  .funnel-title { display: block; }
  .funnel-title span { display: block; margin-top: 3px; }
  .follow-funnel-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .section-number { width: 28px; height: 28px; }
  .button-fields { grid-template-columns: 1fr; }
  .builder-head { align-items: flex-start; flex-direction: column; }
  .editor-actions { display: grid; grid-template-columns: .7fr 1.3fr; padding: 9px; }
  .editor-actions .button { min-width: 0; padding: 0 10px; font-size: 13px; }
  .form-card { padding: 22px 17px; }
  .statistics-metrics > div { padding: 13px 9px; }
  .statistics-metrics.has-followers { grid-template-columns: repeat(2,1fr); }
  .statistics-metrics strong { font-size: 25px; }
  .statistics-metrics small { font-size: 9px; }
  .chart-card { padding: 18px 14px; }
  .chart-card-head,.section-heading-left { align-items: flex-start; flex-direction: column; }
  .chart-legend { flex-wrap: wrap; }
  .automation-stat-row { grid-template-columns: 46px minmax(0,1fr) repeat(4,1fr); }
  .automation-stat-preview { width: 46px; height: 46px; }
  .automation-stat-row .grow { grid-column: 2/-1; }
  .automation-stat-row .row-stat { grid-row: 2; }
  .automation-stat-row > .button { grid-column: 1/-1; width: 100%; justify-self: stretch; }
  .statistics-dialog { padding: 24px 16px 18px; border-radius: 22px; }
  .statistics-dialog h2 { font-size: 23px; }
  .modal-stat-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .modal-stat-controls label { min-width: 0; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; }
}

.attachments-builder { margin: 14px 0 18px; }
.attachment-list { display: grid; gap: 8px; margin-bottom: 9px; }
.attachment-card { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.attachment-preview { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #f1f1f1; color: var(--muted); font-size: 10px; font-weight: 800; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
.attachment-copy { min-width: 0; display: grid; gap: 2px; }
.attachment-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.attachment-copy small { color: var(--muted); font-size: 11px; }
.attachment-controls { display: flex; gap: 3px; }
.upload-zone { min-height: 92px; border: 1.5px dashed #cfcac7; border-radius: 15px; padding: 14px; display: grid; place-items: center; gap: 2px; cursor: pointer; text-align: center; background: var(--background); transition: border-color .15s, background .15s; }
.upload-zone:hover,.upload-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-zone strong { font-size: 13px; }
.upload-zone small { color: var(--muted); font-size: 11px; }
.upload-icon { color: var(--accent); font-size: 22px; line-height: 1; }
.attachment-error { margin: 7px 0 0; }

/* Compact message editor and live Instagram-style preview */
.section-editor-grid { display: grid; grid-template-columns: minmax(0,1fr) 270px; gap: 16px; align-items: start; }
.section-form-column { min-width: 0; }
.material-upload-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 9px; }
.material-slot { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--background); }
.material-slot-head { display: flex; min-height: 35px; align-items: center; gap: 8px; margin-bottom: 8px; }
.material-slot-head strong,.material-slot-head small { display: block; }
.material-slot-head strong { font-size: 12px; }
.material-slot-head small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.material-slot-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 17px; font-weight: 800; }
.material-slot-icon.file { background: var(--line); color: var(--ink); }
.material-slot .attachment-list { margin: 0; }
.material-slot .attachment-card { grid-template-columns: 40px minmax(0,1fr) auto; gap: 7px; padding: 6px; border-radius: 9px; }
.material-slot .attachment-preview { width: 40px; height: 40px; border-radius: 7px; }
.material-slot .attachment-copy strong { font-size: 10px; }
.material-slot .attachment-copy small { font-size: 9px; }
.material-slot .row-control { width: 25px; height: 25px; border-radius: 6px; }
.material-slot .upload-zone { min-height: 88px; padding: 10px; border-radius: 9px; }
.material-note { min-height: 24px; margin: 7px 1px 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.message-preview-panel { min-width: 0; padding: 8px; border: 1px solid #dedee3; border-radius: 14px; background: #f5f5f7; }
.desktop-message-preview { position: sticky; top: 18px; }
.preview-panel-label { display: flex; align-items: center; gap: 6px; padding: 2px 3px 8px; color: #77777d; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.preview-panel-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.instagram-chat-preview { overflow: hidden; border: 1px solid #e4e4e8; border-radius: 11px; background: #fff; box-shadow: 0 5px 15px rgba(30,30,35,.06); }
.instagram-chat-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid #ededf0; background: rgba(255,255,255,.96); }
.instagram-chat-head strong,.instagram-chat-head small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.instagram-chat-head strong { font-size: 11px; }
.instagram-chat-head small { color: var(--muted); font-size: 8px; }
.instagram-chat-avatar { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 2px solid var(--accent); border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 850; }
.instagram-chat-thread { display: flex; min-height: 330px; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 12px 8px; background: #fff; }
.instagram-chat-thread.compact { min-height: 285px; }
.instagram-bubble { width: fit-content; max-width: 88%; overflow: hidden; border-radius: 15px; font-size: 10px; line-height: 1.3; }
.instagram-bubble p { margin: 0; padding: 9px 10px; overflow-wrap: anywhere; }
.instagram-bubble.incoming { align-self: flex-start; border-bottom-left-radius: 5px; background: #eceff3; color: #171719; }
.instagram-bubble.outgoing { align-self: flex-end; border-bottom-right-radius: 5px; background: linear-gradient(135deg,#7838ff,#c825dc); color: #fff; }
.bubble-image { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center; }
.bubble-image[hidden] { display: none; }
.bubble-actions { display: grid; gap: 1px; padding: 0 6px 6px; }
.bubble-actions[hidden] { display: none; }
.bubble-actions span { display: block; padding: 7px 5px; border-radius: 7px; background: #fff; color: #171719; font-size: 10px; font-weight: 750; text-align: center; }
.mobile-preview-button { display: none; width: 100%; margin-top: 10px; }
.mobile-preview-dialog { display: none; }

@media (max-width:1150px) {
  .editor-layout { grid-template-columns: 1fr; }
  .post-panel { position: static; display: grid; grid-template-columns: 160px minmax(0,1fr); }
  .post-preview { aspect-ratio: 1; }
}
@media (max-width:780px) {
  .section-editor-grid { grid-template-columns: 1fr; }
  .desktop-message-preview { display: none; }
  .mobile-preview-button { display: inline-flex; }
  .mobile-preview-dialog[open] { position: fixed; inset: auto 0 0; z-index: 100; display: block; width: 100%; max-width: none; max-height: 88dvh; margin: 0; padding: 8px 14px calc(16px + env(safe-area-inset-bottom,0px)); overflow-y: auto; border: 0; border-radius: 22px 22px 0 0; background: #f8f8fa; box-shadow: 0 -20px 60px rgba(0,0,0,.22); animation: preview-sheet-in .2s ease-out; }
  .mobile-preview-dialog::backdrop { background: rgba(0,0,0,.48); backdrop-filter: blur(2px); }
  .mobile-preview-handle { width: 44px; height: 5px; margin: 1px auto 9px; border-radius: 999px; background: #c9c9ce; touch-action: none; }
  .mobile-preview-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
  .mobile-preview-heading h2 { margin: 0; font-size: 17px; }
  .mobile-preview-heading button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 50%; background: #e8e8eb; color: var(--ink); font-size: 22px; cursor: pointer; }
  .mobile-preview-content { max-width: 390px; margin: 0 auto; }
  .mobile-preview-content .message-preview-panel { display: block; }
  .mobile-preview-content .preview-panel-label { display: none; }
  .mobile-preview-content .instagram-chat-thread { min-height: 330px; }
  @keyframes preview-sheet-in { from { transform: translateY(28px); opacity: .65; } to { transform: translateY(0); opacity: 1; } }
}
@media (max-width: 520px) {
  .material-upload-grid { grid-template-columns: 1fr; }
  .attachment-card { grid-template-columns: 46px minmax(0,1fr); }
  .attachment-preview { width: 46px; height: 46px; }
  .attachment-controls { grid-column: 1/-1; justify-content: flex-end; }
  .material-slot .attachment-card { grid-template-columns: 40px minmax(0,1fr) auto; }
  .material-slot .attachment-controls { grid-column: auto; }
}

/* Instagram content publishing */
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-toolbar .catalog-search { flex: 1 1 460px; max-width: 460px; flex-wrap: nowrap; }
.catalog-toolbar .catalog-search input[type="search"] { flex: 1 1 0; min-width: 0; }
.catalog-toolbar .catalog-search > .button,.catalog-toolbar .catalog-search > a { flex-shrink: 0; }
.catalog-toolbar .publish-launch { flex: 0 0 auto; width: auto; }
.publish-launch span { font-size: 22px; font-weight: 400; line-height: 1; }
.publish-picker-dialog { width: min(680px,calc(100% - 28px)); padding: 30px; border: 0; border-radius: 22px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.publish-picker-dialog::backdrop,.publish-confirm-dialog::backdrop,.publishing-status-dialog::backdrop { background: rgba(15,15,18,.55); backdrop-filter: blur(3px); }
.publish-picker-dialog > p { color: var(--muted); }
.publish-type-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 22px; }
.publish-type-grid a { display: grid; min-height: 160px; align-content: center; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--background); text-decoration: none; transition: border-color .15s,background .15s,transform .15s; }
.publish-type-grid a:hover { border-color: var(--accent-border); background: var(--accent-soft); transform: translateY(-2px); }
.publish-type-grid strong { font-size: 17px; }
.publish-type-grid small { color: var(--muted); }
.publish-type-icon { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 8px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 20px; }
.publishing-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 22px 0; }
.publishing-heading h1 { font-size: clamp(30px,4vw,44px); }
.publishing-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.publication-kind { padding: 8px 13px; border: 1px solid var(--accent-border); border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; }
.publishing-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; padding-bottom: 86px; align-items: start; }
.publishing-fields { display: grid; gap: 14px; min-width: 0; }
.publishing-card { margin: 0; }
.publishing-card-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.publishing-card-title > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 800; }
.publishing-card-title h2 { margin: 2px 0 4px; }
.publishing-card-title p { margin: 0; color: var(--muted); }
.publication-upload-zone { position: relative; display: grid; min-height: 150px; place-items: center; align-content: center; gap: 5px; padding: 20px; border: 2px dashed #d5d1cf; border-radius: 16px; background: var(--background); text-align: center; cursor: pointer; transition: .15s; }
.publication-upload-zone:hover,.publication-upload-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.publication-upload-zone input,.cover-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.publication-upload-zone small { color: var(--muted); }
.publication-upload-icon { color: var(--accent); font-size: 35px; font-weight: 300; line-height: 1; }
.publication-upload-error,.publishing-status-error { margin-top: 10px; padding: 11px 13px; border: 1px solid #ffc6cf; border-radius: 10px; background: var(--danger-soft); color: var(--danger); overflow-wrap: anywhere; }
.publication-file-list { display: grid; gap: 9px; margin-top: 12px; }
.publication-file-card { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.publication-file-thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--line); }
.publication-file-copy { display: grid; min-width: 0; gap: 3px; }
.publication-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.publication-file-copy small { color: var(--muted); }
.publication-file-copy em { color: var(--warning); font-size: 11px; font-style: normal; }
.publication-file-copy input { width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.publication-file-controls { display: flex; gap: 4px; }
.publication-file-controls button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.publication-file-controls button:hover { border-color: var(--accent); color: var(--accent); }
.publication-file-controls button:disabled { opacity: .35; }
.publication-upload-progress { display: grid; gap: 7px; padding: 12px; border-radius: 11px; background: var(--background); }
.publication-upload-progress i,.publishing-progress { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: #e2e2e2; }
.publication-upload-progress b,.publishing-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s; }
.caption-counters { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.caption-counters b { color: var(--ink); }
.publishing-switch { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.publishing-switch input { margin-top: 3px; accent-color: var(--accent); }
.publishing-switch strong,.publishing-switch small { display: block; }
.publishing-switch small { margin-top: 2px; color: var(--muted); }
.cover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; margin-top: 13px; }
.cover-upload { position: relative; display: grid; min-height: 82px; align-content: center; grid-template-columns: auto 1fr; column-gap: 8px; padding: 10px; border: 1px dashed #ccc; border-radius: 10px; cursor: pointer; }
.cover-upload > span { grid-row: 1/3; color: var(--accent); font-size: 24px; }
.cover-upload small { color: var(--muted); }
.publication-preview-card { position: sticky; top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--background); }
.instagram-post-preview { overflow: hidden; border: 1px solid #dedede; border-radius: 12px; background: #fff; box-shadow: 0 8px 25px rgba(0,0,0,.06); }
.instagram-post-preview header { display: flex; align-items: center; gap: 8px; padding: 10px; }
.instagram-post-preview header b { margin-left: auto; letter-spacing: 1px; }
.publication-preview-media { position: relative; display: grid; aspect-ratio: 1/1; place-items: center; overflow: hidden; background: var(--line); color: var(--muted); }
.publication-preview-media img,.publication-preview-media video { width: 100%; height: 100%; object-fit: cover; }
.publication-preview-media > b { position: absolute; top: 9px; right: 9px; padding: 4px 7px; border-radius: 999px; background: rgba(0,0,0,.7); color: #fff; font-size: 10px; }
.instagram-post-actions { display: flex; align-items: center; gap: 14px; padding: 12px 11px 9px; color: #0b0d0f; line-height: 1; }
.instagram-post-actions svg { display: block; width: 24px; height: 24px; flex: 0 0 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.instagram-post-actions .instagram-post-bookmark { margin-left: auto; }
.publication-preview-caption { margin: 0; padding: 4px 11px 13px; font-size: 12px; overflow-wrap: anywhere; }
.publication-preview-caption [data-preview-caption] { white-space: pre-wrap; }
.admin-adaptive-picture { display: contents; }
.admin-adaptive-picture > source { display: none; }
/* Keep an adaptive thumbnail a single grid item, just like the original img. */
.publication-file-card > .admin-adaptive-picture { display: block; min-width: 0; line-height: 0; }
img[data-admin-image] { object-fit: cover; }
.admin-image-unavailable { background: #eeeeef; }
.publication-checklist { padding: 13px 5px 2px; }
.publication-checklist p { margin: 5px 0; color: var(--muted); font-size: 12px; }
.publication-checklist .publication-ratio-warning { color: var(--warning); font-weight: 700; }
.publication-submit-bar { position: fixed; z-index: 35; right: 0; bottom: 0; left: var(--sidebar); display: flex; justify-content: flex-end; gap: 8px; padding: 11px max(26px,calc((100vw - var(--sidebar) - 1180px)/2)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.publish-confirm-dialog { width: min(480px,calc(100% - 28px)); }
.publishing-status-dialog { width: min(500px,calc(100% - 28px)); padding: 32px; border: 0; border-radius: 22px; text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.publishing-status-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 15px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 27px; font-weight: 800; }
.publishing-status-dialog > p { color: var(--muted); }
.publishing-progress { height: 9px; margin-top: 20px; }
.publishing-status-dialog > small { display: block; margin-top: 7px; color: var(--muted); }
.publishing-status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }

@media (max-width: 960px) {
  .publishing-layout { grid-template-columns: 1fr; }
  .publication-preview-card { position: static; max-width: 420px; width: 100%; margin: 0 auto; }
}

/* Saved posts and scheduling */
.publication-scenario-section { grid-column: 1 / -1; min-width: 0; }
.publishing-fields,.publication-scenario-section { width: 100%; max-width: 780px; }
.publication-preview-column { align-self: stretch; min-width: 0; }
@media(min-width:961px) {
  .publication-scenario-section { grid-column: 1; grid-row: 2; }
  .publication-preview-column { grid-column: 2; grid-row: 1 / span 2; }
  .publication-preview-card { max-height: calc(100dvh - 110px); overflow-y: auto; }
}
.scenario-enable { background: #fff; border: 1px solid var(--line); padding: 18px; border-radius: 14px; }
.publication-scenario { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; display: grid; gap: 18px; }
.publication-scenario[hidden] { display: none; }
.upload-zone { position: relative; }
.upload-zone input[type="file"] { width: 1px; height: 1px; left: 0; top: 0; padding: 0; margin: 0; border: 0; }
.upload-zone[hidden] { display: none; }
.publication-scenario .section-editor-grid { grid-template-columns: minmax(0,1fr); }
@media (min-width:781px) {
  .desktop-message-preview { width: 100%; max-width: 320px; justify-self: center; }
}
.keyword-availability { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.keyword-availability.is-error,.scenario-attention { color: var(--danger); }
.scenario-job-layout { display: grid; gap: 20px; max-width: 850px; margin: 24px auto; }
.scenario-summary p,.scenario-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.scenario-summary h3 { margin-top: 18px; }
.scenario-binding select { max-width: 100%; min-width: 0; width: 100%; padding: 12px; }
[data-status-scenario][hidden] { display: none; }
@media(max-width:780px) { .publication-scenario .section-editor-grid { grid-template-columns: minmax(0,1fr); } }
.schedule-trigger svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; }
.schedule-trigger.is-scheduled { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.schedule-trigger span { overflow-wrap: anywhere; }
.schedule-dialog { width: min(460px,calc(100% - 28px)); max-height: 90dvh; overflow: auto; padding: 28px; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 20px 70px rgba(0,0,0,.2); }
.schedule-dialog::backdrop,.scheduled-menu::backdrop { background: rgba(15,15,18,.4); backdrop-filter: blur(3px); }
.schedule-dialog h2 { padding-right: 25px; margin-bottom: 22px; }
.schedule-dialog [hidden] { display: none; }
.schedule-dialog input[type="datetime-local"],.schedule-dialog select { width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.schedule-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.schedule-error { color: var(--danger); background: var(--danger-soft); padding: 12px; border-radius: 9px; overflow-wrap: anywhere; white-space: pre-wrap; }
.uncertain-warning { display: flex; gap: 10px; align-items: flex-start; padding: 13px; margin: 14px 0; border-radius: 10px; background: #fff4dc; color: #725000; text-align: left; }
.uncertain-warning input { width: 18px; height: 18px; flex-shrink: 0; margin: 2px 0 0; accent-color: var(--accent); }
.uncertain-warning[hidden],.schedule-error[hidden],.scheduled-slide[hidden] { display: none; }
.scheduled-feed { width: min(100%,580px); margin: 24px auto; display: grid; gap: 20px; }
.scheduled-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.scheduled-card-header { display: flex; align-items: center; gap: 10px; padding: 14px; }
.scheduled-card-header > a { min-width: 0; flex: 1; text-decoration: none; }
.scheduled-card-header small { display: block; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.scheduled-state { padding: 5px 8px; border-radius: 8px; background: var(--background); font-size: 11px; white-space: nowrap; }
.scheduled-state.failed { color: var(--danger); background: var(--danger-soft); }
.scheduled-state.published { color: var(--success); background: var(--success-soft); }
.scheduled-more { width: 38px; height: 38px; flex-shrink: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; font-size: 24px; cursor: pointer; }
.scheduled-more:hover { background: var(--background); }
.scheduled-slides { position: relative; background: var(--background); }
.scheduled-slide img,.scheduled-slide video { display: block; width: 100%; max-height: 620px; object-fit: contain; -webkit-touch-callout: none; }
.scheduled-slide a { -webkit-touch-callout: none; user-select: none; }
.scheduled-slide-controls { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 8px; }
.scheduled-slide-controls button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 25px; cursor: pointer; }
.scheduled-slide-controls span { font-size: 12px; color: var(--muted); }
.scheduled-copy { padding: 15px; }
.scheduled-caption { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.scheduled-detail .scheduled-caption { display: block; }
.scheduled-menu { position: fixed; inset: 30% auto auto 50%; width: 250px; margin: 0; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 50px rgba(0,0,0,.22); }
.scheduled-menu a,.scheduled-menu button { display: block; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: #fff; text-align: left; text-decoration: none; cursor: pointer; }
.scheduled-menu [hidden] { display: none; }
.scheduled-menu a:hover,.scheduled-menu button:hover { background: var(--background); }
.scheduled-menu .danger { color: var(--danger); }
.scheduled-history { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.scheduled-history summary { cursor: pointer; font-weight: 700; }
.scheduled-history p { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.scheduled-error-heading { margin: 8px 0 0; }
@media (max-width:780px) {
  .publication-submit-bar { flex-wrap: wrap; }
  .publication-submit-bar .schedule-trigger { flex: 1 1 40%; min-width: 0; padding: 8px; font-size: 12px; }
  .publishing-layout { padding-bottom: 135px; }
}
@media (max-width:520px) {
  .schedule-dialog { width: 100%; max-width: none; margin: auto 0 0; padding: 24px 18px calc(20px + env(safe-area-inset-bottom,0px)); border-radius: 22px 22px 0 0; }
  .scheduled-menu { inset: auto 0 0!important; width: 100%; padding: 14px 14px calc(14px + env(safe-area-inset-bottom,0px)); border-radius: 20px 20px 0 0; }
  .scheduled-menu a,.scheduled-menu button { min-height: 46px; }
  .scheduled-card-header { padding: 10px; gap: 6px; }
  .scheduled-card-header strong { font-size: 12px; }
}
@media (max-width: 780px) {
  .publish-type-grid { grid-template-columns: 1fr; }
  .publish-type-grid a { min-height: 92px; grid-template-columns: 48px 1fr; align-content: center; }
  .publish-type-grid .publish-type-icon { grid-row: 1/3; }
  .publish-type-grid small { grid-column: 2; }
  .publishing-heading { align-items: flex-start; flex-direction: column; }
  .publication-submit-bar { left: 0; padding: 9px 12px calc(9px + env(safe-area-inset-bottom,0px)); }
  .publication-submit-bar .button:last-child { flex: 1; }
}
@media (max-width: 520px) {
  .catalog-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .catalog-toolbar .catalog-search { flex: 0 1 auto; max-width: none; }
  .catalog-toolbar .publish-launch { width: 100%; }
  .publish-picker-dialog[open],.publishing-status-dialog[open] { width: 100%; max-width: none; margin: auto 0 0; padding: 24px 17px calc(20px + env(safe-area-inset-bottom,0px)); border-radius: 22px 22px 0 0; }
  .publishing-card { padding: 18px 14px; }
  .publication-file-card { grid-template-columns: 58px minmax(0,1fr); }
  .publication-file-thumb { width: 58px; height: 58px; }
  .publication-file-controls { grid-column: 1/-1; justify-content: flex-end; }
  .cover-grid,.publishing-status-actions { grid-template-columns: 1fr; }
  .publication-submit-bar .button-ghost { display: none; }
}
/* Account retirement: card links and action buttons are separate controls. */
.account-card.account-managed { position: relative; padding: 0; overflow: visible; }
.account-card-link { display: block; padding: 24px; color: inherit; text-decoration: none; }
.account-managed .account-main { padding-right: 28px; }
.account-managed h2 { overflow-wrap: anywhere; }
.account-actions { position: absolute; z-index: 3; right: 12px; top: 12px; }
.account-actions summary { list-style: none; cursor: pointer; border-radius: 12px; padding: 4px 12px; font-size: 25px; }
.account-actions summary::-webkit-details-marker { display: none; }
.account-actions[open] > div { position: absolute; right: 0; min-width: 230px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 35px #17171a20; }
.account-actions button { border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 12px; font: inherit; text-align: left; width: 100%; }
.account-page-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.account-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; border: 0; border-radius: 24px; padding: 24px; color: var(--ink); box-shadow: 0 20px 90px #17171a40; }
.account-dialog::backdrop { background: #18182070; backdrop-filter: blur(5px); }
.account-dialog-head { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; }
.account-dialog h2 { font-size: 22px; overflow-wrap: anywhere; margin: 0; }
.account-dialog p { line-height: 1.65; overflow-wrap: anywhere; }
.account-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.account-dialog-error { color: var(--danger); }
.account-dialog [hidden] { display: none !important; }
.account-dialog button:focus-visible, .account-actions summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
  .account-dialog { padding: 20px; }
  .account-dialog-actions { flex-direction: column-reverse; }
  .account-dialog-actions .button { width: 100%; }
}
.account-page-actions { gap: 10px; flex-wrap: wrap; }
.modules-dialog { width: min(680px,calc(100vw - 32px)); }
.module-toolbar,.module-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.module-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 16px; border: 1px solid var(--border,#e8e8eb); border-radius: 16px; }
.module-card > div { min-width: 0; }
.module-card h3,.module-card p { margin: 0; overflow-wrap: anywhere; }
.module-card p { color: var(--muted); font-size: 13px; }
.module-empty { text-align: center; padding: 36px 8px; color: var(--muted); }
.module-keyword { display: grid; gap: 8px; margin-top: 16px; }
.module-keyword input { width: 100%; box-sizing: border-box; }
.module-telegram-settings { display: grid; gap: 12px; min-width: 0; margin: 20px 0; padding: 16px; border: 1px solid var(--border,#e8e8eb); border-radius: 16px; }
.module-telegram-settings legend { font-weight: 600; padding: 0 6px; }
.module-telegram-settings .module-link-choice { display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; }
.module-telegram-settings input[type="radio"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--accent,var(--accent)); }
.module-telegram-settings input[type="url"] { width: 100%; min-width: 0; box-sizing: border-box; }
.module-telegram-settings input:disabled { opacity: .55; cursor: not-allowed; }
.module-link-help { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
[data-modules-content] > .button { margin: 8px 8px 0 0; }
@media (max-width: 600px) {
  .module-card { align-items: stretch; flex-direction: column; }
  .module-actions .button { flex: 1; }
  .account-page-actions > .button { flex: 1; }
}
.connection-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.connection-dialog p { overflow-wrap: anywhere; line-height: 1.6; }
.connection-username { display: grid; gap: 10px; }
.connection-username input { width: 100%; min-width: 0; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.connection-code { font-size: clamp(30px, 8vw, 46px); font-weight: 700; letter-spacing: .12em; text-align: center; user-select: all; font-variant-numeric: tabular-nums; }
.connection-dialog .account-dialog-actions { flex-wrap: wrap; gap: 8px; }
.connection-dialog .button { white-space: normal; }
.connection-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.connection-dialog [data-connection-content] > .button { display: block; width: 100%; margin-block: 10px; }
.connection-dialog [data-connection-content] > a.button { display: flex; justify-content: center; text-align: center; }
.authorization-settings,.authorization-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-block: 20px; }
.authorization-settings label { display: grid; gap: 8px; flex: 1; }
.authorization-settings p { flex-basis: 100%; }
.authorization-settings select,.authorization-filter input,.authorization-filter select { max-width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: #fff; }
.authorization-list { display: grid; gap: 12px; }
.authorization-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.authorization-card > div { min-width: 0; overflow-wrap: anywhere; }
.authorization-detail { width: min(760px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.authorization-detail p,.authorization-detail details { overflow-wrap: anywhere; line-height: 1.6; }
.authorization-detail details { margin-block: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.authorization-detail textarea { display: block; width: 100%; font: inherit; margin-block: 8px; }
.authorization-pagination { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-block: 20px; }
.post-photo-editor { min-width: 0; margin-block: 18px; padding: 20px; }
.post-photo-editor fieldset, [data-ordinary-fields] { border: 0; margin: 0; padding: 0; min-width: 0; }
.post-photo-editor .field { display: flex; flex-direction: column; gap: 8px; margin-block: 16px; }
.post-photo-editor input:not([type=checkbox]), .post-photo-editor textarea, .post-photo-editor select { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; }
.post-photo-editor textarea { resize: vertical; }
.post-photo-editor p { overflow-wrap: anywhere; }
@media(max-width:600px){.authorization-card{align-items:stretch;flex-direction:column}.authorization-filter>*{width:100%}.authorization-settings label{flex-basis:100%}.authorization-detail .account-dialog-actions{position:sticky;bottom:0;background:#fff;flex-wrap:wrap}.mobile-nav a{min-width:0}}
@media (max-width: 600px) {
  .connection-dialog .account-dialog-actions { position: sticky; bottom: 0; background: #fff; padding-block: 12px; }
  .connection-dialog .account-dialog-actions .button { flex: 1 1 100%; }
}
