/* Почта: папки, список, письмо и его написание.
   Часть общего каскада: порядок подключения — ui.Stylesheets. */
/* This screen wants the window, so it takes back the page's tail padding. */
/* The mail takes the whole window under the menu — every pixel of width and
   height that is left once the top bar has its row. The body becomes a
   column: the header keeps its natural height, and the working area fills
   the rest, so the mail never has to guess how tall the header is or leave a
   margin of dead space below itself. The page itself does not scroll; each
   pane scrolls inside the mail. */
body:has(#mailbox){overflow:hidden}
body:has(#mailbox) #app{display:flex;flex-direction:column;height:100vh;height:100dvh}
body:has(#mailbox) .top{flex:0 0 auto}
body:has(#mailbox) .wrap{
  flex:1 1 auto;min-height:0;max-width:none;width:100%;margin:0;padding:0;
}
body:has(#mailbox) .screen.on.mailer{
  height:100%;min-height:0;border-radius:0;border-left:0;border-right:0;border-bottom:0;
}

.mbox-folders{
  border-right:1px solid var(--line);
  background:var(--soft);
  padding:18px 14px;
  overflow:auto;
  /* A grid child is min-height:auto by default and will not shrink below
     its content — so a long folder rail, a full list or a long letter push
     the section past its fixed height and the whole page scrolls, with no
     scrollbar of their own. min-height:0 lets each pane stay at the cell
     height and scroll inside it, which is the point of three panes. */
  min-height:0;
}
.mbox-folders h1{font-size:20px;margin:0}
.mbox-folders p.small{margin:4px 0 16px;line-height:1.45}
.mbox-folders nav{display:flex;flex-direction:column;gap:2px}
.mbox-folders a{
  display:flex;align-items:center;gap:9px;
  padding:8px 10px;border-radius:var(--r-s);
  font-size:14px;color:var(--ink);text-decoration:none;cursor:pointer;
}
.mbox-folders a:hover{background:var(--sunk);text-decoration:none}
.mbox-folders a[aria-current="true"]{background:var(--wash);color:var(--accent-2);font-weight:500}
.mbox-folders a svg{flex-shrink:0;opacity:.75}
.mbox-folders a .n{margin-left:auto;font-size:12.5px;color:var(--ink-3);font-variant-numeric:tabular-nums}
.mbox-folders a[aria-current="true"] .n{color:var(--accent-2)}
/* The name of a mailbox, over the folders that belong to it. Two of
   these, and the whole point of the rail is that a person can see at a
   glance which side of the trade they are reading. */
.mbox-folders .sep{margin:18px 0 6px;padding:0 10px;font-size:11.5px;
  letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);
  font-weight:600}
.mbox-folders .sep:first-child{margin-top:0}
/* A box's name folds its folders away: an office one does not work in
   stays shut. */
.mbox-folders .sep-fold{display:flex;align-items:center;gap:6px;width:100%;
  border:0;background:none;cursor:pointer;text-align:left;font-family:inherit}
.mbox-folders .sep-fold:hover{color:var(--ink)}
.sep-caret{display:inline-block;transition:transform .15s;font-size:14px;line-height:1}
.sep-fold[aria-expanded="true"] .sep-caret{transform:rotate(90deg)}
.mbox-folders .none{margin:2px 0 0;padding:6px 10px;font-size:12.5px;
  color:var(--ink-3);line-height:1.4}
.mbox-folders a span:not(.n){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.mbox-list{display:flex;flex-direction:column;border-right:1px solid var(--line);min-width:0;min-height:0}
.mbox-find{padding:13px 14px 9px;border-bottom:1px solid var(--line)}
.mbox-find .btn-cmd{margin-bottom:10px}
.mbox-find .small{margin:9px 2px 0}
/* The filter bar under the search: the button that unfolds the panel, and
   a way to clear it once something is set. */
.mbox-fbar{display:flex;align-items:center;gap:10px;margin-top:9px}
.mbox-find .mbox-fbar .btn-cmd{margin-bottom:0}
.mbox-fbar .mb-ftoggle[aria-expanded=true]{background:var(--wash);color:var(--accent-2)}
.mbox-fcount{min-width:17px;height:17px;padding:0 5px;border-radius:9px;
  background:var(--accent);color:#fff;font-size:11px;font-weight:600;
  display:inline-flex;align-items:center;justify-content:center}
.mbox-fbar .linkish{margin:0;padding:0;border:0;background:none;color:var(--accent);cursor:pointer}
.mbox-fbar .linkish:hover{text-decoration:underline}
.mbox-filters{display:grid;grid-template-columns:1fr 1fr;gap:8px 10px;margin-top:10px}
.mbox-filters label{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:12px;color:var(--ink-3)}
.mbox-filters select,.mbox-filters input{width:100%;min-width:0;height:30px;font:inherit;font-size:13px;
  color:var(--ink);background:var(--panel);border:1px solid var(--line-2);border-radius:6px;padding:0 6px}
.mbox-filters select:disabled{opacity:.55}
.mbox-frange{grid-column:1/-1;display:flex;align-items:center;gap:6px}
/* The dashboard's own period: two days beside the period buttons. */
.d-period{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.d-range{display:flex;align-items:center;gap:6px}
.d-range input{height:32px;font:inherit;font-size:13px;color:var(--ink);background:var(--panel);
  border:1px solid var(--line-2);border-radius:6px;padding:0 6px}
.mbox-items{list-style:none;margin:0;padding:0;overflow:auto;flex:1}
.mbox-items li{
  display:block;position:relative;width:100%;text-align:left;cursor:pointer;
  padding:11px 14px 12px 12px;
  border-bottom:1px solid var(--line);
  border-left:3px solid transparent;
}
.mbox-items li:hover{background:var(--soft)}
.mbox-items li[aria-selected="true"]{background:var(--wash);border-left-color:var(--accent)}
.mbox-items .r1{display:flex;align-items:baseline;gap:10px}
.mbox-items .who{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mbox-items .when{margin-left:auto;font-size:12px;color:var(--ink-3);white-space:nowrap;flex-shrink:0}
/* The paperclip sits where Outlook keeps it: the bottom-right corner of
   the row, on the preview line, hard against the edge — not up on the
   sender line. Absolute so it lands there whether the row has a preview
   line or only a subject, and the two text lines leave it room on the
   right so nothing runs under it. */
.mbox-items .clip{position:absolute;right:14px;bottom:11px;color:var(--ink-3)}
.mbox-items .subj{font-size:13.5px;margin:2px 0 0;padding-right:18px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.mbox-items .snip{font-size:12.5px;color:var(--ink-3);margin:3px 0 0;padding-right:18px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Unread is weight and a dot, not colour: a list where half the rows are
   blue says nothing about which of them is new. */
.mbox-items li.new .who,.mbox-items li.new .subj{font-weight:600}
.mbox-items li.new .who::before{
  content:"";display:inline-block;width:7px;height:7px;border-radius:50%;
  background:var(--accent);margin-right:7px;vertical-align:middle;
}
.mbox-items .tag{display:inline-block;margin-top:6px;font-size:11.5px;
  padding:2px 7px;border-radius:20px;background:var(--sunk);color:var(--ink-2)}
.mbox-items .tag.filed{background:var(--wash);color:var(--accent-2)}
.mbox-empty-row{padding:34px 18px;color:var(--ink-3);font-size:13.5px;text-align:center}
.mbox-more{padding:10px 14px;border-top:1px solid var(--line)}

.mbox-read{overflow:auto;min-width:0;min-height:0;display:flex;flex-direction:column}
.mbox-empty{margin:auto;text-align:center;color:var(--ink-3);padding:40px}
.mbox-empty p{margin:14px 0 0;font-size:14px}
.mbox-head{padding:22px 26px 16px;border-bottom:1px solid var(--line)}
.mbox-head h2{margin:0;font-size:20px;line-height:1.35;overflow-wrap:anywhere}
.mbox-who{display:flex;align-items:center;gap:12px;margin-top:16px}
.mbox-who-t{min-width:0}
.mbox-who .nm{margin:0;font-weight:500;font-size:14px;overflow-wrap:anywhere}
.mbox-who .rl{margin:2px 0 0;font-size:13px;color:var(--ink-3);overflow-wrap:anywhere}
.mbox-who .small{margin-left:auto;white-space:nowrap;align-self:flex-start}
.mbox-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
/* The letter's own command, beside the reply buttons: a divider then the
 * button, sized to the command bar. Empty until a letter is open, when it
 * draws nothing. */
.mbox-make{display:inline-flex;align-items:center;gap:2px}
/* display:flex would otherwise beat the browser's own rule for [hidden],
   which leaves an empty bordered strip on every letter without an
   attachment — visible, unexplained, and on most of them. */
.mbox-files{padding:14px 26px;border-bottom:1px solid var(--line);
  font-size:13px;color:var(--ink-2);display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.mbox-files[hidden]{display:none}
.mbox-files .file{display:inline-flex;align-items:center;gap:6px;
  padding:5px 10px;border:1px solid var(--line);border-radius:var(--r-s);background:var(--soft)}
/* The letter as it was written: its own line breaks, its own spacing.
   Reflowing a supplier's price list into a paragraph loses the columns. */
/* A measure, not the width of the window: a supplier's paragraph set
   across 900 pixels is a paragraph nobody finishes. */
.mbox-body{padding:22px 26px 40px;max-width:82ch;white-space:pre-wrap;
  overflow-wrap:anywhere;font-size:14.5px;line-height:1.62}
.mbox-body[hidden]{display:none}

/* The frame a letter's own markup is shown in. Its height is set from
   the letter once it has laid itself out — a fixed height would either
   waste half the pane or hide the end of a quotation. */
.mbox-frame{width:100%;border:0;display:block;min-height:220px;background:var(--panel)}
.mbox-frame[hidden]{display:none}

/* Pictures a letter wants to fetch from somebody else's server, held
   back until they are asked for. Said plainly, because the reason is
   worth knowing: a one-pixel image is how a sender learns the letter was
   opened. */
.mbox-held{margin:0;padding:11px 26px;background:var(--warn-wash);
  color:var(--warn);font-size:13px;display:flex;align-items:center;gap:12px;
  border-bottom:1px solid var(--line)}
.mbox-held[hidden]{display:none}
.mbox-held button{font:inherit;font-weight:500;color:var(--accent);background:none;
  border:0;padding:0;cursor:pointer;text-decoration:underline}

.mbox-files .file{text-decoration:none;color:var(--ink)}
.mbox-files a.file:hover{background:var(--wash);border-color:var(--line-2);text-decoration:none}
.mbox-files .file .sz{color:var(--ink-3);font-size:12px}

/* Narrow windows drop the reading pane under the list rather than
   squeezing three columns into six hundred pixels. */
@media (max-width:1180px){
  .screen.on.mailer{height:auto;min-height:0}
  .mbox-home{grid-template-columns:200px minmax(0,1fr)}
  .mbox-read{grid-column:1/-1;border-top:1px solid var(--line);max-height:none}
  .mbox-items{max-height:420px}
}

/* The developer's organisation switcher. Quiet by design: it is chrome for
   one hidden account, not a feature the product advertises. */
.dev-switch{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--ink-3)}
.dev-switch span{white-space:nowrap}
.dev-switch select{font:inherit;color:var(--ink);background:var(--sunk);
  border:1px solid var(--line);border-radius:7px;padding:4px 8px;max-width:190px}

/* The reply/forward buttons on an open letter. Quiet: they sit with the
   letter, not above the product. */
.mbox-reply{display:flex;gap:2px;flex-wrap:nowrap;align-items:center}

/* ── the letter, and the letter being written ──────
   Both take the whole screen. Finding a letter wants three panes; reading
   one wants the window, and so does answering it — a supplier's price
   list is columns, and columns do not survive a third of a screen or a
   dialog box.

   Written against the id so it outranks `.screen.on.mailer`, which is
   three classes and would otherwise keep its three columns. */
/* Reading full-width (double click): the letter takes the block, the list
   steps aside, and the folders shrink to a rail of icons — still there to
   switch between, but out of the letter's way. A single click leaves this
   class off, so the three panes hold and the letter reads in the pane. */
#mailbox.reading .mbox-home{grid-template-columns:64px minmax(0,1fr)}
#mailbox.reading .mbox-list{display:none}
#mailbox.reading .mbox-folders{padding:14px 6px}
#mailbox.reading .mbox-folders h1,
#mailbox.reading .mbox-folders p,
#mailbox.reading .mbox-folders .sep,
#mailbox.reading .mbox-folders a .n,
#mailbox.reading .mbox-folders a span:not(.n){display:none}
#mailbox.reading .mbox-folders a{justify-content:center;padding:9px 0;gap:0}
#mailbox.reading .mbox-folders a svg{opacity:.9}

/* The command bar: the way back on the left, the commands beside it. It
   stays put while the letter scrolls under it — the answer to a long
   letter is decided at its end, which is the one place a bar that
   scrolled away would not be. */
.mbox-cmd{display:flex;align-items:center;flex-wrap:wrap;gap:1px;row-gap:4px;
  padding:7px 10px;border-bottom:1px solid var(--line);background:var(--soft);
  position:sticky;top:0;z-index:2}
.mbox-cmd .bar{width:1px;height:18px;margin:0 4px;background:var(--line-2);flex-shrink:0}
.mbox-cmd h2{margin:0;font-size:13.5px;font-weight:600;color:var(--ink-2);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mbox-cmd .keys{margin-left:auto;font-size:12px;color:var(--ink-3);white-space:nowrap}

/* The letter being written. Three lines of envelope, then the rest of the
   window for what is being said — the body grows with the pane instead of
   the pane being sized to a guess about the body. */
.mbox-write{display:flex;flex-direction:column;min-width:0;overflow:auto}
.mbox-write[hidden]{display:none}
.mbox-write .fail{margin:14px 22px 0;padding:11px 14px;border-radius:var(--r-s);
  background:var(--crit-wash);color:var(--crit);font-size:14px;line-height:1.5}
.mbox-write .fail[hidden]{display:none}
.mbox-fields{padding:4px 22px 0}
.mbox-fields .ln{display:flex;align-items:center;gap:12px;
  border-bottom:1px solid var(--line);min-width:0}
.mbox-fields label{width:74px;flex-shrink:0;font-size:13px;color:var(--ink-3);
  padding:12px 0}
/* No box around each line: an address bar is not a form field, it is a
   line of the letter's own head. The rule under it is the only edge it
   needs, and it is what Outlook and every other client draw. */
/* Longhands, not the `font` shorthand: its family part cannot be
   `inherit`, and a shorthand that names one is dropped whole — which is
   how a textarea keeps the browser's monospace default and a letter is
   written in the wrong typeface. */
.mbox-fields input,.mbox-fields select{flex:1;min-width:0;height:42px;padding:0;
  border:0;background:none;color:var(--ink);border-radius:0;
  font-family:inherit;font-size:14.5px;font-weight:400;line-height:1}
.mbox-fields input:focus,.mbox-fields select:focus{outline:none;box-shadow:none}
.mbox-fields .ln:focus-within{border-bottom-color:var(--accent)}
.mbox-fields select{cursor:pointer}
.mbox-text{flex:1;min-height:280px;margin:0;padding:18px 22px 26px;border:0;
  background:none;color:var(--ink);resize:none;overflow-wrap:anywhere;
  font-family:inherit;font-size:14.5px;font-weight:400;line-height:1.62}
.mbox-text:focus{outline:none}

/* The files chosen for a letter being written: a chip each, with the size
   and a cross to take it back off. */
.mbox-attach{display:flex;flex-wrap:wrap;gap:8px;padding:0 26px 14px}
.mbox-attach .chip{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;
  padding:4px 6px 4px 10px;border-radius:20px;background:var(--sunk);color:var(--ink-2)}
.mbox-attach .chip .sz{color:var(--ink-3)}
.mbox-attach .chip .x{border:0;background:transparent;color:var(--ink-3);cursor:pointer;
  font-size:15px;line-height:1;padding:0 4px;border-radius:50%}
.mbox-attach .chip .x:hover{background:var(--line-2);color:var(--ink)}

/* The "To" field with its contacts book and the list it suggests. The
   input takes the room, the book sits at its right, and the suggestions
   drop beneath — the shape every mail client's address field has. */
.mb-to{position:relative;display:flex;align-items:center;gap:6px}
.mb-to input{flex:1;min-width:0}
.mb-ccbcc-toggle{flex-shrink:0;background:none;border:0;color:var(--accent);
  font-weight:500;font-size:12.5px;line-height:1;font-family:inherit;cursor:pointer;padding:2px 4px;white-space:nowrap}
.mb-ccbcc-toggle:hover{text-decoration:underline}
.mb-extra[hidden]{display:none}
.mb-to-book{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;border:1px solid var(--line);border-radius:var(--r-s);
  background:var(--sunk);color:var(--ink-2);cursor:pointer}
.mb-to-book:hover{background:var(--line-2);color:var(--ink)}
.mb-to-book .i{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;
  stroke-linecap:round;stroke-linejoin:round}
.mb-to-menu{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:5;
  margin:0;padding:4px;list-style:none;max-height:280px;overflow:auto;
  background:var(--panel);border:1px solid var(--line);border-radius:var(--r-s);
  box-shadow:0 10px 30px rgba(0,0,0,.18)}
.mb-to-menu li{display:flex;flex-direction:column;gap:1px;padding:7px 9px;
  border-radius:6px;cursor:pointer}
.mb-to-menu li[aria-selected="true"],.mb-to-menu li:hover{background:var(--wash)}
.mb-to-menu .who{font-size:13.5px;color:var(--ink)}
.mb-to-menu .addr{font-size:12px;color:var(--ink-3)}
.mb-to-menu .none{color:var(--ink-3);font-size:13px;cursor:default}
.mb-to-menu .none:hover{background:transparent}
