/* Почта как привычный ящик: папки слева, поиск сверху, жёлтая «Написать». */
:root {
  --ys-yellow: #fc0;
  --ys-yellow-hover: #f5c400;
  --ys-bg: #f2f2f2;
  --ys-panel: #ffffff;
  --ys-line: #e5e5e5;
  --ys-text: #000000;
  --ys-muted: #898989;
  --ys-hover: #f7f7f7;
  --ys-on: #fff3c4;
  --ys-side: 232px;
  --ys-list: 400px;
  --ys-top: 56px;
}

html, body, #layout {
  background: var(--ys-bg) !important;
  font-family: Arial, Helvetica, sans-serif !important;
  color: var(--ys-text);
}

#ys-topbar {
  display: none;
}

/* ===== Вход ===== */
body.task-login,
body.task-login #layout,
body.task-login #layout-content {
  background: var(--ys-bg) !important;
}

body.task-login #logo {
  display: none !important;
}

body.task-login #login-form::before {
  content: "Почта";
  display: block;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
}

#login-form {
  background: #fff !important;
  border: 0 !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .08) !important;
  padding: 28px 24px 20px !important;
  max-width: 360px !important;
  top: 18vh !important;
}

#login-form .form-control,
#rcmloginuser,
#rcmloginpwd {
  border: 1px solid #d9d9d9 !important;
  border-radius: 8px !important;
  height: 44px !important;
  background: #fff !important;
}

#login-form .formbuttons button,
#rcmloginsubmit {
  background: var(--ys-yellow) !important;
  color: #000 !important;
  border: 0 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  height: 44px !important;
  width: 100% !important;
}

#login-footer { display: none !important; }

/* ===== Рабочий стол: три колонки, шапка сверху ===== */
@media screen and (min-width: 769px) {
  html.ys-ready body.task-mail:not(.action-compose):not(.action-show),
  html.ys-ready body.task-addressbook,
  html.ys-ready body.task-settings {
    overflow: hidden;
  }

  html.ys-ready #ys-topbar {
    display: flex !important;
    align-items: center;
    gap: 16px;
    height: var(--ys-top);
    min-height: var(--ys-top);
    padding: 0 16px 0 20px;
    background: var(--ys-bg);
    box-sizing: border-box;
    flex-shrink: 0;
  }

  html.ys-ready body.task-mail:not(.action-compose) #layout,
  html.ys-ready body.task-addressbook #layout,
  html.ys-ready body.task-settings #layout {
    height: calc(100% - var(--ys-top)) !important;
  }

  html.ys-ready #layout-menu {
    display: none !important;
  }

  .ys-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(var(--ys-side) - 20px);
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
  }

  .ys-brand:before {
    content: "";
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--ys-yellow);
    flex-shrink: 0;
  }

  .ys-search-slot {
    flex: 1;
    max-width: 720px;
    margin: 0 auto;
  }

  .ys-search-slot .searchbar {
    height: 40px !important;
    min-height: 40px !important;
    line-height: 40px !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  }

  .ys-search-slot .searchbar form:before,
  .ys-search-slot .searchbar a:before {
    height: 40px !important;
  }

  .ys-search-slot input,
  .ys-search-slot #mailsearchform {
    background: transparent !important;
    border: 0 !important;
    font-size: 15px !important;
  }

  .ys-user-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: #000;
    font-size: 13px;
  }

  .ys-user-slot .username {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
  }

  .ys-user-slot a {
    color: var(--ys-muted) !important;
    text-decoration: none !important;
    padding: 6px 8px !important;
    border-radius: 8px !important;
  }

  .ys-user-slot a:hover {
    background: #e8e8e8 !important;
    color: #000 !important;
  }

  .ys-user-slot a:before {
    display: none !important;
  }

  .ys-user-slot a .inner {
    display: inline !important;
    font-size: 13px !important;
  }

  html.ys-ready #layout-sidebar {
    flex: 0 0 var(--ys-side) !important;
    width: var(--ys-side) !important;
    max-width: none !important;
    min-width: 0 !important;
    background: var(--ys-bg) !important;
    border-right: 0 !important;
  }

  html.ys-ready body.task-mail:not(.action-compose) #layout-list {
    flex: 0 0 var(--ys-list) !important;
    width: var(--ys-list) !important;
    max-width: none !important;
    min-width: 0 !important;
    background: #fff !important;
    border-right: 1px solid var(--ys-line) !important;
  }

  html.ys-ready #layout-content {
    flex: 1 1 auto !important;
    background: #fff !important;
  }

  #ys-compose-wrap {
    padding: 8px 16px 12px;
  }

  #ys-compose-wrap a.compose {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    background: var(--ys-yellow) !important;
    color: #000 !important;
    border: 0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    float: none !important;
  }

  #ys-compose-wrap a.compose:before {
    display: none !important;
  }

  #ys-compose-wrap a.compose .inner {
    display: inline !important;
    font-size: 15px !important;
    font-weight: 700 !important;
  }

  #ys-compose-wrap a.compose:hover {
    background: var(--ys-yellow-hover) !important;
  }

  html.ys-ready #layout-sidebar > .header {
    display: none !important;
  }

  html.ys-ready #layout-sidebar > .footer {
    background: transparent !important;
    border: 0 !important;
    color: var(--ys-muted) !important;
    font-weight: 400 !important;
  }

  #mailboxlist {
    padding: 0 8px !important;
  }

  #mailboxlist li {
    border: 0 !important;
    margin: 2px 0 !important;
  }

  #mailboxlist li a {
    border-radius: 8px !important;
    padding: 8px 12px !important;
    color: #000 !important;
    line-height: 20px !important;
    border-left: 0 !important;
  }

  #mailboxlist li.selected > a,
  #mailboxlist li.selected {
    background: var(--ys-on) !important;
    font-weight: 700 !important;
  }

  #mailboxlist li a:hover {
    background: #e8e8e8 !important;
  }

  #mailboxlist li.selected > a:hover {
    background: var(--ys-on) !important;
  }

  #messagelist-header {
    height: 48px !important;
    min-height: 48px !important;
    border-bottom: 1px solid var(--ys-line) !important;
    background: #fff !important;
    justify-content: flex-start !important;
    padding: 0 8px !important;
  }

  #messagelist-header .header-title,
  #messagelist-header .toolbar,
  #messagelist-header a.task-menu-button,
  #messagelist-header a.back-sidebar-button,
  #messagelist-header a.toolbar-menu-button,
  #messagelist-header a.toolbar-list-button {
    display: none !important;
  }

  #messagelist-header a.refresh {
    margin-left: auto !important;
  }

  #layout-list > .pagenav {
    display: none !important;
  }

  html.ys-ready #layout-list > .searchbar {
    display: none;
  }

  #layout-content > .header {
    height: 48px !important;
    min-height: 48px !important;
    background: #fff !important;
    border-bottom: 1px solid var(--ys-line) !important;
    justify-content: flex-start !important;
  }

  #layout-content > .header > .header-title {
    display: none !important;
  }

  #layout-content > .header a.compose {
    display: none !important;
  }

  #layout-content > .header a .inner,
  #mailtoolbar a .inner,
  #messagelist-header a .inner {
    display: none !important;
  }

  #mailtoolbar.toolbar a,
  #layout-content > .header .toolbar a {
    max-width: none !important;
    min-width: 40px !important;
    color: #000 !important;
  }

  html.ys-ready #layout-sidebar > .footer,
  #quotadisplay {
    display: none !important;
  }

  .listing-info {
    font-size: 0 !important;
    border: 0 !important;
  }

  .listing-info::after {
    content: "Писем нет";
    font-size: 15px;
    color: var(--ys-muted);
  }

  body.action-compose a.responses,
  body.action-compose a.spellcheck,
  body.action-compose .toolbar .dropbutton,
  body.action-compose a.html,
  body.action-compose #composefooter a.extwin,
  body.action-compose .extwin {
    display: none !important;
  }

  .messagelist {
    background: #fff !important;
  }

  .messagelist tbody td,
  .messagelist li {
    border-bottom: 1px solid #f0f0f0 !important;
  }

  .messagelist tr:hover td {
    background: var(--ys-hover) !important;
  }

  .messagelist tr.selected td {
    background: var(--ys-on) !important;
  }

  .messagelist td.subject {
    padding: 10px 12px 10px 8px !important;
  }

  .messagelist td.subject span.fromto {
    font-size: 14px !important;
    color: #000 !important;
    padding-left: 0 !important;
    order: 2;
    flex: 1;
  }

  .messagelist td.subject span.date {
    font-size: 12px !important;
    color: var(--ys-muted) !important;
    order: 3;
  }

  .messagelist td.subject span.subject {
    order: 4;
    font-size: 13px !important;
    color: var(--ys-muted) !important;
    padding-left: 44px;
  }

  .messagelist tr.unread td.subject span.fromto,
  .messagelist tr.unread td.subject span.subject a {
    font-weight: 700 !important;
    color: #000 !important;
  }

  .ys-ava {
    order: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
    line-height: 32px !important;
  }

  /* Написать письмо — одна колонка, без правой панели настроек */
  html.ys-ready body.action-compose #layout-menu {
    display: none !important;
  }

  html.ys-ready body.action-compose #layout-sidebar.sidebar-right {
    display: none !important;
  }

  html.ys-ready body.action-compose #layout-content {
    width: 100% !important;
    max-width: 920px !important;
    margin: 0 auto !important;
    background: #fff !important;
    border-left: 0 !important;
  }

  html.ys-ready body.action-compose #layout {
    background: var(--ys-bg) !important;
  }

  body.action-compose #layout-content > .header {
    justify-content: flex-start !important;
  }

  body.action-compose #layout-content > .header > .header-title {
    display: none !important;
  }

  button.send,
  .btn.send,
  a.send {
    background: var(--ys-yellow) !important;
    color: #000 !important;
    border: 0 !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    min-width: 120px !important;
    box-shadow: none !important;
  }

  #compose-headers .col-form-label {
    color: var(--ys-muted) !important;
    font-weight: 400 !important;
  }

  #compose-headers .form-control,
  #compose-headers input {
    border: 0 !important;
    border-bottom: 1px solid var(--ys-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
  }
}

/* Общее */
#logo { filter: none; }

.special-buttons a.about,
.special-buttons a.theme {
  display: none !important;
}

#messagestack {
  font-family: Arial, Helvetica, sans-serif;
}
