@font-face {
  font-family: Vazirmatn;
  src: url("/static/vendor/vazirmatn-33.0.3.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f6f4fa; --surface: #fff; --subtle: #f3eff8; --text: #261b36; --muted: #665a75;
  --border: #e6deee; --accent: #5e37b1; --accent-soft: #efe6fc; --accent-text: #fff;
  --nav: #20172b; --nav-text: #d7cce3; --nav-active: #3c2a52; --danger: #a62850;
  --wash: #e9dcf9; --shade: #32174f0e; --radius: 20px;
  font-family: Vazirmatn, Tahoma, 'Segoe UI', sans-serif;
}
:root[data-theme="dark"], :root[data-theme="violet"] {
  color-scheme: dark; --bg: #15121b; --surface: #201b29; --subtle: #19151f; --text: #f8f2ff; --muted: #bfb2cd;
  --border: #3b3049; --accent: #c9b0ff; --accent-soft: #39294e; --accent-text: #221138;
  --nav: #191420; --nav-text: #cdbedc; --nav-active: #392a4e; --danger: #ffc0cf;
  --wash: #2a1c3b; --shade: #0a06152e;
}
:root[data-theme="violet"] { --bg: #17101e; --surface: #23192d; --subtle: #1c1425; --nav: #1b1323; --wash: #332044; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 87% 0, var(--wash), transparent 35rem), var(--bg); color: var(--text); line-height: 1.65; }
button, select, input, textarea { font: inherit; }
button, .button, select, input, textarea { border: 1px solid var(--border); border-radius: 12px; }
button, .button { display: inline-flex; gap: .45rem; align-items: center; justify-content: center; background: var(--surface);
  color: var(--text); padding: .6rem .9rem; min-height: 42px; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--subtle); }
button:disabled { opacity: .56; cursor: wait; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 700; }
button.primary:hover, .button.primary:hover { filter: brightness(1.08); }
.quiet { background: transparent; border-color: transparent; }
.ui-icon { width: 1.25rem; height: 1.25rem; flex: none; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, .composer:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, select, textarea { padding: .62rem .75rem; background: var(--surface); color: var(--text); min-width: 0; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type="file"] { max-width: 100%; }
.shell { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100vh; }
aside { background: var(--nav); color: white; min-height: 100%; padding: 1.65rem 1rem; display: flex; flex-direction: column; border-inline-end: 1px solid #ffffff0e; }
.brand { display: flex; gap: .65rem; align-items: center; text-decoration: none; color: white; direction: ltr; justify-content: center; font-size: 1.13rem; font-weight: 750; }
.brand b { font-weight: 400; color: #ccc2ef; }
nav { display: grid; margin: 2.25rem 0 1rem; gap: .26rem; }
nav button { color: var(--nav-text); padding: .68rem .85rem; background: transparent; border: 0; justify-content: start; font-size: .88rem; gap: .65rem; }
nav button:hover, nav button[aria-current="page"] { color: white; background: var(--nav-active); }
nav button[aria-current="page"] { font-weight: 700; }
nav button[aria-current="page"] .ui-icon { color: #d1baff; }
main { width: 100%; max-width: 1280px; min-width: 0; margin-inline: auto; padding: 2.3rem clamp(1.25rem,3vw,3rem) 4rem; }
main[data-screen="editor"] { max-width: 985px; }
main:focus { outline: none; }
.head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1.45rem; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: clamp(1.55rem,4vw,2.25rem); font-weight: 830; letter-spacing: -.035em; }
h2,h3 { margin: 0 0 .75rem; font-size: 1.06rem; } h3 { font-size: .94rem; }
p { margin: .4rem 0 .85rem; }
.muted, small { color: var(--muted); } small { display: block; font-size: .8rem; }
.surface { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat strong { display: block; font-size: 1.65rem; font-weight: 700; }
.col { display: grid; gap: .9rem; min-width: 0; }
.topline, .actions, .inline-fields, .toolbar, .filters { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.topline { justify-content: space-between; }
.editor-content { gap: .78rem; }
.channel-intro { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .85rem;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  background: linear-gradient(110deg,var(--surface),var(--accent-soft)); }
.channel-intro h2 { margin: 0 0 .1rem; font-size: 1.06rem; }
.channel-intro p { margin: 0; color: var(--muted); font-size: .87rem; }
.channel-intro-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 15px;
  background: var(--surface); color: var(--accent); border: 1px solid var(--border); }
.channel-intro-icon .ui-icon { width: 1.42rem; height: 1.42rem; }
.channel-intro .actions { justify-content: flex-end; }
.compose-panel { padding: .85rem; box-shadow: 0 16px 42px -26px var(--shade); }
.toolbar { padding: .15rem 0 .7rem; }
.selected { color: var(--accent); background: var(--accent-soft); }
.toolbar .emoji-tool { min-height: 46px; gap: .45rem; padding: .5rem .85rem; font-size: .94rem; font-weight: 820; }
.media-tool { min-height: 44px; padding: .4rem .7rem; font-size: .84rem; }
.media-tool .ui-icon { color: var(--muted); width: 1.1rem; height: 1.1rem; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.compose-panel:has(#upload:focus-visible) .media-tool { outline: 2px solid var(--accent); outline-offset: 3px; }
.compose-panel:has(#upload:disabled) .media-tool { opacity: .63; cursor: wait; }
.upload-feedback:not(:empty) { display: flex; align-items: center; gap: .55rem; margin-top: .55rem; padding: .5rem .65rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--subtle); font-size: .82rem; }
.upload-feedback progress { width: min(28%,5rem); height: .6rem; flex: none; accent-color: var(--accent); }
.format-tools { gap: .2rem; margin-top: .55rem; }
.format-tools button { min-height: 41px; padding: .32rem .68rem; border-color: transparent; color: var(--muted); background: transparent; font-size: .81rem; }
.format-tools button:hover { color: var(--accent); background: var(--accent-soft); }
.format-tools button[data-key="bold"] { font-weight: 800; }
.format-tools button[data-key="italic"] { font-style: italic; }
.optional summary { cursor: pointer; font-weight: 650; color: var(--text); }
.optional[open] > summary { margin-bottom: .7rem; }
.optional > .field, .optional > .actions, .optional > .row-list:not(:empty) { margin-bottom: .7rem; }
.editor-actions { justify-content: flex-start; }
.editor-actions button { min-height: 46px; }
.publication-status:not(:empty) { margin-top: .45rem; gap: .35rem; }
.publication-status .button,.publication-status button { min-height: 29px; padding: .15rem .5rem; font-size: .76rem; background: transparent; }
.publication-reason { flex-basis: 100%; line-height: 1.5; }
.channel-rule { background: var(--accent-soft); padding: .58rem .75rem; border-radius: 10px; font-size: .86rem; }
.operation-status { display: flex; padding: .58rem .75rem; background: var(--accent-soft); border-radius: 10px; }
.operation-indicator { display: inline-flex; align-items: center; gap: .45rem; color: var(--accent); font-size: .86rem; font-weight: 650; }
.operation-spinner { display: inline-block; flex: none; width: 1em; height: 1em; border: 2px solid currentColor;
  border-inline-end-color: transparent; border-radius: 50%; }
#publication-status .operation-indicator { font-size: .77rem; }
.admin-login { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 1.2rem; }
.admin-login main { width: min(100%,26rem); padding: 1.6rem; box-shadow: 0 16px 48px var(--shade); }
.admin-login h1 { margin: .55rem 0 1.1rem; font-size: 1.5rem; }
.admin-login .primary { justify-self: stretch; }
.admin-login-icon { display: block; }
.admin-activity { width: min(94vw,760px); }
.admin-post p { flex-basis: 100%; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
[data-admin-web] #toast { bottom: 1rem; }
.more-list { display: grid; gap: .55rem; }
.more-list button { justify-content: flex-start; }
form.col > button { justify-self: start; }
.toolbar button[aria-pressed="true"], .filters button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.composer { min-height: 250px; min-height: clamp(226px,36dvh,350px); background: var(--subtle); border: 1px solid var(--border);
  border-radius: 15px; padding: 1.05rem; scroll-margin-block: 1rem 11rem; font-size: 1.04rem; line-height: 1.95;
  unicode-bidi: plaintext; overflow-wrap: anywhere; white-space: pre-wrap; }
.composer:focus-visible { outline-offset: 1px; }
.composer:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.emoji-visual { position: relative; display: inline-grid; place-items: center; width: 1.36em; height: 1.36em;
  vertical-align: -.23em; flex: 0 0 auto; user-select: none; }
.emoji-visual:not([data-rendered])::after { content: "◇"; font-size: .9em; color: var(--accent); position: absolute; }
.emoji-visual[data-visual-error]::after { color: var(--muted); }
.emoji-visual > svg, .emoji-visual > img, .emoji-visual > video { width: 100% !important; height: 100% !important; object-fit: contain; }
.token { border-radius: 4px; background: var(--accent-soft); }
.composer .spoiler { background: var(--accent-soft); border-radius: 3px; }
label.field { display: grid; gap: .37rem; font-size: .85rem; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: .65rem; margin: .7rem 0; }
.field input, .field select, .field textarea { width: 100%; }
.row-list { display: grid; gap: .55rem; }
.row { display: flex; justify-content: space-between; gap: .7rem; flex-wrap: wrap; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: .64rem .8rem; overflow-wrap: anywhere; }
.row a { overflow-wrap: anywhere; }
.asset { position: relative; background: var(--subtle); border-radius: 12px; overflow: hidden; min-width: 0; }
.assets:not(:empty) { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(76px,96px); justify-content: start;
  gap: .5rem; margin-top: .65rem; overflow-x: auto; overscroll-behavior-inline: contain; }
.asset img,.asset video { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.asset button { position: absolute; top: .22rem; inset-inline-end: .22rem; padding: 0; min-height: 28px; min-width: 28px;
  border: 0; border-radius: 50%; color: #fff; background: #1b132ddb; }
.asset button .ui-icon { width: .9rem; height: .9rem; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(84px,1fr)); gap: .55rem; margin: .8rem 0; }
.emoji-card { display: grid; justify-items: center; gap: .18rem; padding: .42rem; background: var(--subtle); border-radius: 10px; }
.emoji-card .symbol { font-size: 1.7rem; min-height: 46px; width: 100%; }
.symbol .emoji-visual { width: 36px; height: 36px; }
.emoji-card button { padding: .25rem .4rem; }
.pill { color: var(--accent); background: var(--accent-soft); padding: .16rem .52rem; border-radius: 16px; font-size: .72rem; white-space: nowrap; }
.warn { color: var(--danger); }
.loading { padding: 2rem 0; color: var(--muted); }
#toast { position: fixed; inset-inline: max(1rem,env(safe-area-inset-left)); bottom: max(1rem,env(safe-area-inset-bottom)); width: fit-content; max-width: calc(100vw - 2rem); margin-inline: auto; background: var(--nav); color: white; border-radius: 10px; padding: .7rem 1rem; z-index: 20; }
.dialog-status { margin-top: .6rem; padding: .5rem .65rem; border-radius: 8px; background: var(--accent-soft); color: var(--text); }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: min(94vw,630px); max-height: 85vh; padding: 1.1rem; }
dialog::backdrop { background: #0f091aaf; }
.dialog-heading { margin-bottom: .65rem; }
.dialog-heading h2 { margin: 0; font-size: 1.13rem; }
.dialog-heading > button { padding: .3rem .66rem; min-height: 40px; background: transparent; }
.picker-sheet[open] { display: flex; flex-direction: column; height: min(610px,82vh); height: min(610px,82dvh);
  overflow: hidden; padding: 1rem; }
.picker-content { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.picker-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(144px,38%); gap: .45rem; padding-bottom: .65rem; }
.picker-filters select { width: 100%; background: var(--subtle); }
.picker-search { display: grid; grid-template-columns: minmax(0,1fr) auto; border: 1px solid var(--border);
  border-radius: 12px; background: var(--subtle); }
.picker-search input { width: 100%; padding-inline: .63rem .15rem; border: 0; background: transparent; }
.picker-search button { padding: 0 .63rem; color: var(--accent); }
.picker-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: .18rem .12rem; }
.picker-sheet .emoji-grid { grid-template-columns: repeat(auto-fill,minmax(61px,1fr)); gap: .37rem; margin: 0; }
.emoji-grid > p { grid-column: 1 / -1; }
.picker-sheet .emoji-card { padding: 0; background: transparent; }
.picker-sheet .symbol { min-height: 54px; aspect-ratio: 1; border-color: var(--border); background: var(--subtle); }
.picker-sheet .symbol:hover, .picker-sheet .symbol:focus-visible { background: var(--accent-soft); }
.picker-footer { display: flex; justify-content: space-between; align-items: center; gap: .45rem;
  border-top: 1px solid var(--border); padding-top: .55rem; }
.picker-footer button { min-height: 40px; font-size: .84rem; }
@media (max-width: 850px) { .shell { grid-template-columns: 176px minmax(0,1fr); } }
@media (max-width: 630px) {
  :root { --mobile-nav: calc(60px + env(safe-area-inset-bottom)); }
  .shell { display: block; }
  aside { display: block; position: fixed; z-index: 11; inset-inline: 0; bottom: 0; min-height: 0;
    height: var(--mobile-nav); padding: .28rem .4rem env(safe-area-inset-bottom); border-top: 1px solid #ffffff12; }
  aside .brand { display: none; }
  nav { margin: 0; gap: .1rem; grid-template-columns: repeat(4,minmax(0,1fr)); }
  nav button { min-width: 0; gap: .11rem; flex-direction: column; justify-content: center;
    padding: .29rem .05rem; font-size: clamp(.66rem,2.7vw,.79rem); white-space: nowrap; }
  nav .ui-icon { width: 1.19rem; height: 1.19rem; }
  main { padding: .95rem .82rem calc(var(--mobile-nav) + 1.2rem); }
  main[data-screen="editor"] { padding-bottom: calc(var(--mobile-nav) + 8.4rem); }
  .head { margin-bottom: .66rem; }
  .surface { padding: .8rem; }
  .channel-intro { gap: .55rem .68rem; grid-template-columns: auto minmax(0,1fr); padding: .75rem; }
  .channel-intro .actions { grid-column: 1 / -1; justify-content: start; }
  .channel-intro .actions button { min-height: 39px; padding: .32rem .7rem; }
  .compose-panel { padding: .65rem; }
  .editor-dock { position: fixed; z-index: 10; inset-inline: 0; bottom: var(--mobile-nav); background: var(--surface);
     border-top: 1px solid var(--border); padding: .58rem .82rem; box-shadow: 0 -10px 28px -17px var(--shade); }
  .editor-actions { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: .42rem; }
  .editor-actions button { padding-inline: .35rem; }
  .composer { min-height: 224px; min-height: clamp(205px,38dvh,325px); padding: .72rem; }
  .format-tools button { padding-inline: .53rem; }
  .toolbar { gap: .34rem; }
  .toolbar .emoji-tool,.media-tool { padding-inline: .5rem; }
  .toolbar .emoji-tool { font-size: .86rem; }
  .media-tool { font-size: .78rem; }
  .picker-sheet[open] { inset: auto 0 0; width: 100%; max-width: none; margin: 0; border-inline: 0; border-bottom: 0;
    border-radius: 25px 25px 0 0; max-height: 90dvh; height: 77vh; height: 77dvh;
    padding: .9rem max(.82rem,env(safe-area-inset-right)) max(.62rem,env(safe-area-inset-bottom)); }
  .picker-filters { grid-template-columns: minmax(0,1fr) minmax(116px,38%); }
  .picker-sheet .emoji-grid { grid-template-columns: repeat(auto-fill,minmax(52px,1fr)); }
  .picker-sheet .symbol { min-height: 48px; }
  #toast { bottom: calc(var(--mobile-nav) + .58rem); }
  body:has(main[data-screen="editor"]) #toast { bottom: calc(var(--mobile-nav) + 5.2rem); }
}
@media (max-width: 630px) and (max-height: 480px) {
  .editor-dock { position: static; padding: .5rem 0; border: 0; background: transparent; box-shadow: none; }
  main[data-screen="editor"] { padding-bottom: calc(var(--mobile-nav) + 1rem); }
  .composer { min-height: 160px; }
}
@keyframes operation-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  button { transition: background .12s ease; }
  .operation-spinner { animation: operation-spin .75s linear infinite; }
}
