/* chrome.css — the header, the footer and the notices, for EVERY page.

   One definition of the site's frame, loaded by both kinds of page:
     the three public pages   tokens → chrome → style … pages → footer → site
     every other page         tokens → chrome → footer → app

   Everything here used to live in two places: the header rules at the top of
   the theme's style.css (moved here verbatim by the theme split, 28 Shahrivar
   1405) and the Django additions in site.css (the signed-in menu, the notices,
   the Telegram button, the identity rows and the seal). The panel pages never
   load style.css — its global `svg` rule would stroke every chart on them — so
   anything the frame needs has to be here, scoped to the frame.

   ⚠️ The panel's app.css loads AFTER this on panel pages and sets global rules
   of its own (`a { color: var(--tint) }`, `a:hover { opacity }`, heading
   sizes). The last block below pins the frame's own values so the header and
   footer look the same on a panel page as on the home page. */

/* ---- The font, from our own server ------------------------------------
   The static theme pulled Vazirmatn from fonts.googleapis.com. The Django site
   has always served it itself, and that stays: a customer's home connection is
   not a datacentre, and a font that has to cross the border before any text
   renders is a page that loads blank on the network this service is for. Same
   file and same declaration as css/app.css. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn[wght].f6d31671339d.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

/* ---- The theme's header, moved from style.css --------------------------- */
.icon-defs{position:absolute;width:0;height:0;overflow:hidden}.container{width:min(1220px,calc(100% - 96px));margin-inline:auto}.skip{position:fixed;top:-70px;right:20px;padding:12px;background:var(--surface);z-index:100}.skip:focus{top:10px}.header{background:var(--glass);border-bottom:1px solid var(--surface-2)}.nav{height:99px;display:flex;align-items:center;justify-content:space-between;gap:28px}.brand{display:inline-flex;align-items:center}.brand img{object-fit:contain;mix-blend-mode:multiply;width:125px;height:61px}.nav nav{display:flex;gap:35px;font-size:14px;font-weight:500}.nav nav a:hover{color:var(--accent-dark)}.button{background:var(--accent-dark);color:var(--on-accent);display:inline-flex;align-items:center;justify-content:center;gap:20px;padding:15px 23px;border-radius:12px;font-size:15px;font-weight:600;border:1px solid transparent;box-shadow:0 8px 20px var(--accent-glow);transition:background .2s,transform .2s}.button:hover{background:var(--accent-dark);transform:translateY(-2px)}.button-small{padding:10px 19px;font-size:14px;gap:18px}.button svg{width:20px;height:20px}.menu-toggle{display:none;border:0;background:none;color:var(--ink)}.footer{display:flex;gap:20px;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-block:25px;margin-top:70px}.footer .brand img{width:90px;height:44px}.footer p{font-size:14px;color:var(--muted)}.footer>span{font-size:12px;color:var(--muted)}
@media(max-width:1100px){.container{width:calc(100% - 56px)}}
@media(max-width:760px){.container{width:calc(100% - 36px)}.nav{height:80px;gap:15px}.brand img{width:100px;height:49px}.nav-cta{margin-right:auto;font-size:14px;padding:8px 13px;gap:10px}.menu-toggle{display:grid;place-items:center;padding:7px}.nav nav{display:none;position:absolute;top:80px;left:0;right:0;background:var(--surface);border-bottom:1px solid var(--line);padding:25px;z-index:20;box-shadow:0 12px 15px var(--shadow)}.nav nav.open{display:flex;flex-wrap:wrap;gap:20px 26px}.footer{flex-wrap:wrap;margin-top:45px;gap:10px}.footer>span{width:100%;text-align:center}.footer p{font-size:14px}}

/* The theme's icons are line drawings: no fill, a round 1.7 stroke. In
   style.css that is a GLOBAL svg rule, which is right for the public pages and
   wrong for the panel, whose charts are svg too. Here it is scoped to the frame. */
.header svg,.site-footer svg,.site-notices svg,.skip svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}

/* ---- Header additions ---------------------------------------------------- */
.nav nav a[aria-current=page] { color: var(--accent-dark); }
.nav .nav-login { display: inline-flex; align-items: center; gap: 6px; }
.nav .nav-login svg { width: 17px; height: 17px; }
.nav nav form { margin: 0; display: contents; }
.nav .nav-logout {
  font: inherit; font-size: 14px; font-weight: 500; color: inherit;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.nav .nav-logout:hover { color: var(--accent-dark); }
/* Counters on «پشتیبانی» and «صف تیکت‌ها», and the wallet dot. Same meaning as
   on the panel header: the number is unread replies; the dot is «something new»
   and deliberately not a count. */
.nav .nav-count b {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px;
  margin-inline-start: 5px; padding: 0 5px; border-radius: 10px;
  /* --accent-dark, not --accent: white on the light orange measured 2.65:1
     (3 Mehr 1405). Same swap the hero heading took on 29 Shahrivar. */
  background: var(--accent-dark); color: var(--on-accent); font-size: 11px; font-weight: 700;
}
.nav .nav-dot i {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-inline-start: 5px; vertical-align: middle; background: var(--accent-dark);
}
.menu-toggle.has-unread { position: relative; }
.menu-toggle.has-unread::after {
  content: ""; position: absolute; top: 5px; left: 5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent-dark);
}

/* ⚠️ The theme's header was drawn for five links. A visitor gets six plus the
   button; a signed-in customer gets eight or nine plus «خروج». Letting that row
   overflow would push the logo off the page, so the menu folds into the button
   earlier: at 980px for everyone. It was 1180, then 1260 on 30 Shahrivar when
   «بلاگ» made the staff row twelve items; grouping the staff tools and the
   account pages into two menus on 3 Mehr cut that row from 870px to 675px, so
   one breakpoint serves both again. The rules are
   the theme's own ≤760px rules, repeated at the wider width. */
@media (max-width: 980px) {
  .site-public .nav { gap: 15px; }
  .site-public .menu-toggle { display: grid; place-items: center; padding: 7px; }
  .site-public .nav nav {
    display: none; position: absolute; top: 99px; left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 25px; z-index: 20;
    box-shadow: 0 12px 15px var(--shadow);
  }
  .site-public .nav nav.open { display: flex; flex-wrap: wrap; gap: 20px 26px; }
  .site-public .nav-cta { margin-right: auto; }
}
@media (max-width: 980px) {
  .site-member .nav { gap: 15px; }
  .site-member .menu-toggle { display: grid; place-items: center; padding: 7px; }
  .site-member .nav nav {
    display: none; position: absolute; top: 99px; left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 25px; z-index: 20;
    box-shadow: 0 12px 15px var(--shadow);
  }
  .site-member .nav nav.open { display: flex; flex-wrap: wrap; gap: 20px 26px; }
}
@media (min-width: 981px) {
  .site-member .nav nav { gap: 22px; font-size: 13.5px; }
}
@media (max-width: 760px) {
  .site-public .nav nav, .site-member .nav nav { top: 80px; }
}
.header { position: relative; }

/* ---- Notices: messages, the operator's announcement, targeted notices,
        the recovery-code nag and the renewal question ---------------------- */
.site-notices { display: grid; gap: 12px; padding-top: 20px; }
.site-alert {
  padding: 16px 20px; border-radius: 14px; font-size: 14.5px; line-height: 2;
  background: var(--info-soft); border: 1px solid var(--info-line); color: var(--info-ink);
}
.site-alert b { font-weight: 700; }
.site-alert a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 4px; }
.site-alert.is-warning { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.site-alert.is-success { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.site-alert.is-error { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad-ink); }
.site-alert form { margin-top: 10px; }
.site-alert .button, .site-renewal .button { padding: 9px 16px; font-size: 14px; gap: 10px; }
.button-quiet {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
}
.button-quiet:hover { background: var(--surface-2); }
.site-renewal {
  padding: 22px 24px; border-radius: 18px; background: linear-gradient(120deg, var(--mint-soft), var(--accent-soft));
  border: 1px solid var(--mint-line);
}
.site-renewal h3 { margin: 0 0 6px; font-size: 18px; }
.site-renewal .choices { display: flex; gap: 22px; margin: 12px 0 16px; }
.site-renewal label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.site-renewal textarea {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); margin-bottom: 14px;
}

/* ---- Telegram, bottom-left of every page ---------------------------------
   `left`, not a logical property: the page is RTL and the operator asked for
   bottom-LEFT, which `inset-inline-start` would flip to the right. */
.tg-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 30; width: 52px; height: 52px;
  display: grid; place-items: center; border-radius: 50%; background: #2aa3dc; color: #fff;
  box-shadow: 0 10px 25px #1b6e9a40; transition: transform .2s;
}
.tg-fab:hover { transform: translateY(-3px); }
.tg-fab svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.footer-social svg.tg-glyph { fill: currentColor; stroke: none; }

/* ---- Footer additions ---------------------------------------------------- */
.footer-about .footer-legal-name { font-weight: 600; color: var(--muted); margin: -6px 0 14px; font-size: 15px; }
.footer-rows { display: grid; gap: 10px; }
.footer-rows li { line-height: 2.1; }
.footer-rows b { font-weight: 600; color: var(--muted); }
.footer-rows a { direction: ltr; }
/* The seal plate. ⚠️ The issuer's <a><img> goes inside `.seal` byte-for-byte
   (|safe, from the TrustSeal table) — eNamad treats any edit to its snippet as
   a violation, and adding rel="noopener noreferrer" to their anchor is the
   documented way to stop the badge rendering. So the plate styles the WRAPPER
   and reaches into their markup only by element, never by adding attributes. */
.footer-seal .seal {
  display: flex; align-items: center; justify-content: center; background: var(--surface);
  border: 1px solid var(--mint-line); border-radius: 15px; padding: 12px 10px; max-width: 155px;
  min-height: 150px; box-shadow: 0 8px 25px var(--shadow);
}
.footer-seal .seal img { width: 125px; height: auto; max-height: 136px; object-fit: contain; }
.footer-seal .seal + .seal { margin-top: 12px; }
.footer-seal .seal.is-pending { border-style: dashed; }
.footer-seal .seal.is-pending img { opacity: 0; }


/* ---- The frame, pinned against app.css -----------------------------------
   Only what app.css would otherwise change. Higher specificity than its
   element rules, so load order stops mattering. */
.header,.site-footer{color:var(--ink);font-family:var(--font)}
.header a,.site-footer a,.site-notices .site-renewal a{color:inherit;text-decoration:none}
.header a:hover,.site-footer a:hover{opacity:1}
.header img,.site-footer img{display:inline-block}
.site-footer h2{line-height:1.6;letter-spacing:0}
.site-footer p,.site-footer li,.site-footer address{letter-spacing:0}
/* «دسترسی سریع» at the mockup's rhythm (30 Shahrivar 1405). The design set body
   line-height 1.9 and its footer links inherit it; the old-site type block
   (site.css) and app.css both set body to 1.65, which packed the four links 3px
   tighter per row than the mockup — measured 37px against the mockup's 40.5
   (73 image px at its 1.8 scale). Pinned here so both kinds of page agree. */
.site-footer ul{line-height:1.9}
.header .button,.site-notices .button{color:var(--on-accent)}
.site-notices .button-quiet{color:var(--ink)}

/* ⚠️ `.button` above is var(--accent-dark), not --accent: the design set its
   buttons to #bd5022 in connect.css, which the panel pages never load, so the
   header's «شروع» came out bright orange there (white on it: 2.65:1) and
   burnt orange on the home page. One colour now, everywhere. */

/* ---- Light / dark switch ---------------------------------------------------
   Shows the glyph of the theme it would switch TO: a moon on a light page, a
   sun on a dark one. Outside the <nav>, so a folded phone menu cannot hide it. */
.theme-toggle{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer;flex-shrink:0;padding:0}
.theme-toggle:hover{border-color:var(--accent-line);color:var(--accent-dark)}
.header .theme-toggle svg{width:19px;height:19px}
.theme-toggle .icon-sun{display:none}
:root[data-theme="dark"] .theme-toggle .icon-sun{display:block}
:root[data-theme="dark"] .theme-toggle .icon-moon{display:none}
@media (max-width:760px){.theme-toggle{width:36px;height:36px}}

/* ---- The logo in the dark theme --------------------------------------------
   The theme draws it with mix-blend-mode:multiply, which on a light header is
   invisible and on a dark one multiplies the orange down to near-black. The
   artwork is transparent, so in the dark it simply draws as it is. */
:root[data-theme="dark"] .brand img{mix-blend-mode:normal}
@media (prefers-color-scheme:dark){:root:not([data-theme]) .brand img{mix-blend-mode:normal}}


/* ---- The header row: one standard instead of four equal gaps --------------
   Operator, 29 Shahrivar 1405: the menu should sit NEAR the logo, the logo is
   too big, and «ورود · شروع · روشن/تاریک» should travel together.

   ⚠️ The cause was one declaration. The theme's `justify-content:space-between`
   spread FOUR children across the 1220px container, so at 1440px every gap
   measured EXACTLY 156px — logo→links, links→شروع, شروع→switch. Nothing was
   "too far" by a little; the bar had no grouping at all.

   The standard applied here:

     logo → links        28px   (the row gap, plus 12px on the brand)
     link → link         26px   guest · 22px signed in (nine links, not six)
     the three controls  16px apart, as one group at the far end
     everything else     one flexible gap, absorbed by the link list

   The link list carries `flex:1`, so the leftover width lands BETWEEN the
   links and the controls instead of being shared out four ways. «ورود» is the
   last child of <nav>, so an auto margin there moves it across that gap to
   join «شروع» — no template change, and on a phone (where <nav> is absolute
   and folded) the rule is switched off so it cannot push «ورود» around inside
   the open menu. */
.header .nav { justify-content: flex-start; gap: 16px; }
.header .nav > .brand { margin-inline-end: 12px; }
.header .nav > nav { flex: 1 1 auto; gap: 26px; font-size: 15px; }

/* The logo. 125x61 in a 99px bar left 19px of air above and below and read as
   oversized next to 15px links. 104x50 is half the bar's height, the ratio of
   the artwork (130:63) kept to the pixel. */
.header .brand img { width: 104px; height: 50px; }

/* ---- One row, one baseline, two clusters (4 Mehr 1405) -------------------
   The operator, with a screenshot: the labels sit at different heights, and the
   account menu is nowhere near the light/dark button. Measured on the real
   signed-in markup at 1440px, before:

     plain links     text centre 43.1px    ← 6px ABOVE the bar's centre
     the two menus   text centre 49.1px    ← on it (49.5)
     account → theme toggle                  395.6px of nothing

   One cause behind both. <nav> never set `align-items`, so every child
   stretched to the tallest, and only <summary> carried padding: the links' text
   sat at the top of a 37px box while the menus' sat inside their own padding.
   And the bar's leftover width piles up after the LAST child of <nav> — signed
   in, that is the account menu, which is why it stayed glued to «مدیریت».

   So every child of <nav> gets the same box: a pill with the same padding, on a
   centred row. The links keep their 26px of air — 4px gap plus 2×11px padding —
   except that the air is now part of the target and takes the hover and the
   current-page mark. A row of links reads as one set of controls that way, and
   the target grows from a 22px line of text to a 37px box.

   Then the account menu takes the leftover width (the public bar already does
   this with «ورود») and lands beside the theme toggle, with a border and the
   toggle's own height so the two read as one cluster: where you go on one side,
   who you are and what you switch on the other. */
@media (min-width: 981px) {
  .header .nav > nav { align-items: center; gap: 4px; }
  .site-member .nav > nav { font-size: 15px; }
  .header .nav > nav > a { padding: 7px 11px; border-radius: 10px; transition: background .2s, color .2s; }
  .header .nav > nav > .nav-menu > summary { padding: 7px 11px; }
  .header .nav > nav > a:hover { background: var(--surface-2); }
  .header .nav > nav > a[aria-current="page"] { background: var(--accent-soft); }
  .site-member .nav .nav-account { margin-inline-start: auto; }
  .nav-account > summary {
    border: 1px solid var(--line); border-radius: 12px;
    min-height: 40px; padding-inline: 12px;
  }
  .nav-account > summary:hover { border-color: var(--accent-line); }
  .nav-account[open] > summary { border-color: var(--accent-line); }
}

/* Unfolded only: move «ورود» across the flexible gap to join the controls. */
@media (min-width: 981px) { .site-public .nav .nav-login { margin-inline-start: auto; } }

/* Folded: <nav> is absolutely positioned, so `flex:1` no longer holds the gap
   open and the controls would bunch against the logo. The first control takes
   the auto margin instead. (`margin-inline-start` is `margin-right` here — the
   page is RTL — which is what the theme's own `margin-right:auto` meant.) */
@media (max-width: 980px) { .site-member .nav .theme-toggle { margin-inline-start: auto; } }
@media (max-width: 980px)  { .site-public .nav .nav-cta { margin-inline-start: auto; } }

@media (max-width: 760px) {
  .header .nav { gap: 12px; }
  .header .brand img { width: 88px; height: 43px; }
  .header .nav > nav { gap: 20px 26px; }
}

/* ---- The two header menus (3 Mehr 1405) ---------------------------------
   A signed-in operator had eleven links and «خروج» flat in the bar. The bar now
   holds destinations; «مدیریت» and the account menu hold the rest.

   Built on <details>/<summary>: it opens by keyboard and with JS off, and inside
   the folded phone menu it expands in place rather than floating. app.js adds
   only Escape and click-outside. Colours are tokens, like everything here. */
.nav-menu { position: relative; }
.nav-menu > summary {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 15px; font-weight: 500; color: inherit; list-style: none;
  padding: 6px 10px; border-radius: 10px; white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover { color: var(--accent-dark); background: var(--surface-2); }
.nav-menu > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.nav-menu[open] > summary { background: var(--accent-soft); color: var(--accent-dark); }
.nav-chevron {
  width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .2s;
}
.nav-menu[open] .nav-chevron { transform: rotate(180deg); }
.nav-account > summary > svg:first-child { width: 17px; height: 17px; }
.nav-account-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }

.nav-pop {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 30;
  min-width: 13rem; display: grid; gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 40px var(--shadow);
}
.nav .nav-pop a, .nav-pop .nav-logout {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500;
  color: var(--ink-2); width: 100%; text-align: start;
}
.nav .nav-pop a:hover, .nav-pop .nav-logout:hover { background: var(--surface-2); color: var(--accent-dark); }
.nav .nav-pop a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); }
.nav-pop form { margin: 0; display: block; }
.nav-pop .nav-logout { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; padding-top: 12px; }
.nav-pop-count {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--accent-dark); color: var(--on-accent); font-size: 11px; font-weight: 700;
}
.nav-dot-mark {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-dark); flex-shrink: 0;
}

/* Folded menu: the popup becomes part of the list instead of floating over it. */
@media (max-width: 980px) {
  .site-member .nav nav.open .nav-menu { width: 100%; }
  .site-member .nav nav.open .nav-pop {
    position: static; box-shadow: none; border: 0; border-inline-start: 2px solid var(--line);
    border-radius: 0; margin: 4px 0 0; padding: 0 14px 0 0; min-width: 0;
  }
}

/* ---- the account's picture in the bar (4 Mehr 1405) ---------------------
   The same ladder as the account page: a photograph, then a ready-made badge,
   then the plain glyph. Sized to the glyph it replaces so the row's height
   never depends on which rung an account is on. */
.nav-avatar {
  width: 22px; height: 22px; border-radius: var(--r-pill);
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.nav-avatar-vector {
  width: 17px; height: 17px; color: var(--accent-dark);
}

/* A <button> does not inherit font-family: without this it falls back to the
   browser's own control font, which is how «F» on the badge picker and the
   guide's close button ended up in Arial on a page of Vazirmatn. 5 Mehr 1405. */
button, input, select, textarea, optgroup { font-family: inherit; }

/* Every piece of text on the site justified — 11 Mehr 1405, operator's request.
   ON <body>, BY INHERITANCE, and that is the whole design of it:
   · a section that is deliberately centred (hero, CTA, footer line, `.center`)
     sets its own text-align and keeps it — a rule on `p` would have overridden
     that and pushed every centred paragraph to justify;
   · a single line is unchanged, because `text-align-last` stays `auto`, which
     puts the last line of a justified block at the start. Buttons, labels,
     chips, IP addresses and one-line notes therefore do not move at all; only
     text that actually wraps gets even edges.
   `inter-word` because Persian is justified by widening the spaces, never by
   pulling letters apart. Headings get `text-wrap: balance` so a two-line title
   is split into two near-equal lines and justification has nothing to stretch. */
body { text-align: justify; text-justify: inter-word; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
