/*
 * The flat phone skin (DECISIONS 86): the look of the mockup David approved, laid over the phone
 * layout. It loads only when PHONE_SKIN is 'flat' (the default; src/config.js), which also puts
 * the phone-skin-flat class on <html>; PHONE_SKIN=2018 leaves the phone pages in the theme's
 * textures and square corners. Every rule is inside the phone block and scoped to that class, so
 * desktop never sees any of it.
 *
 * Flat: a plain #0b0a08 page, flat boxes (#121210, 1px #363224, a #0f0f0d title bar), flat
 * header and nav bars, rounded buttons and count pills, a round avatar, a fade at the tab strip's
 * edge and a rounded account sheet. Touch targets stay 44px; the header buttons are drawn 36px
 * tall inside them, as in the mockup.
 */
@media (max-width: 767.98px) {
  /* The page: plain, edge to edge; the content sits 12px in. */
  .phone-skin-flat body {
    background: #0b0a08;
  }

  .phone-skin-flat #page {
    margin: 0;
  }

  .phone-skin-flat .columns,
  .phone-skin-flat .columns-full,
  .phone-skin-flat .home-phone {
    gap: 12px;
    margin: 12px 12px 0;
  }

  /* Header */
  .phone-skin-flat .phone-header {
    box-sizing: border-box;
    padding: 0 7px 0 12px;
    border-bottom: 1px solid #2a2720;
    background-color: #0f0e0b;
  }

  .phone-skin-flat .phone-header-actions {
    margin-right: 5px;
  }

  .phone-skin-flat .phone-header .phone-btn {
    position: relative;
    isolation: isolate;
    border: 0;
    background: none;
  }

  .phone-skin-flat .phone-header .phone-btn::before {
    content: '';
    position: absolute;
    inset: 4px 0;
    z-index: -1;
    border: 1px solid #59534c;
    border-radius: 4px;
  }

  .phone-skin-flat .phone-header .phone-btn.phone-btn-primary::before {
    border-color: #e9bd7f;
    background-color: #e9bd7f;
  }

  .phone-skin-flat .phone-header .phone-btn.phone-btn-primary:hover::before,
  .phone-skin-flat .phone-header .phone-btn.phone-btn-primary:focus::before {
    border-color: #fff;
    background-color: #fff;
  }

  .phone-skin-flat .phone-btn,
  .phone-skin-flat .element_button {
    border-radius: 4px;
  }

  /* Avatars in the header and the sheet: round, with a gold ring. */
  .phone-skin-flat .element_avatar.simple.phone-avatar {
    padding: 0;
    overflow: hidden;
    border: 2px solid #e9bd7f;
    border-radius: 50%;
    background-color: #3a3526;
  }

  .phone-skin-flat .phone-badge {
    top: 3px;
    right: 1px;
    border-radius: 9px;
  }

  .phone-skin-flat .phone-count {
    padding: 0 6px;
    border-radius: 9px;
  }

  /* The banner, edge to edge. */
  .phone-skin-flat .banner {
    padding: 0;
    border-bottom: 1px solid #363224;
  }

  /* Nav: a flat bar, More behind a plain divider, the strip fading out at its right edge. */
  .phone-skin-flat .phone-nav {
    border-bottom: 1px solid #4d4845;
    background-color: #17160f;
  }

  .phone-skin-flat .phone-nav::before,
  .phone-skin-flat .phone-nav::after,
  .phone-skin-flat .phone-nav-more::before,
  .phone-skin-flat .phone-nav-more::after {
    content: none;
  }

  .phone-skin-flat .phone-tabs {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }

  .phone-skin-flat .phone-nav-more {
    border-left: 1px solid #4d4845;
  }

  .phone-skin-flat .phone-nav-more[aria-expanded='true'],
  .phone-skin-flat .phone-nav-close {
    background-color: #0d0c0a;
    font-weight: bold;
    color: #fff8c9;
  }

  .phone-skin-flat .phone-more-search .phone-btn {
    border-radius: 0;
    background-color: #2a2720;
  }

  /* Boxes: flat, with a flat title bar (titles on the left) or none. */
  .phone-skin-flat .container {
    border: 1px solid #363224;
    background-color: #121210;
  }

  .phone-skin-flat .container_header::before,
  .phone-skin-flat .container_header::after,
  .phone-skin-flat .container_footer::before,
  .phone-skin-flat .container_footer::after,
  .phone-skin-flat .container_content::before,
  .phone-skin-flat .container_content::after {
    content: none;
  }

  .phone-skin-flat .container .container_header,
  .phone-skin-flat .container .container_footer {
    height: 0;
  }

  .phone-skin-flat .container.with-header .container_header {
    height: 36px;
    border-bottom: 1px solid #363224;
    background-color: #0f0f0d;
  }

  .phone-skin-flat .container.with-header .container_header .title {
    text-align: left;
  }

  .phone-skin-flat .container.with-header .container_header .header_text_text {
    padding-top: 11px;
    padding-left: 12px;
    letter-spacing: 0.6px;
  }

  .phone-skin-flat .container_header .header-link {
    padding-bottom: 8px;
    line-height: 36px;
  }

  .phone-skin-flat .container .container_body {
    padding: 0;
    background: none;
  }

  .phone-skin-flat .container .container_content {
    background: #121210;
  }

  /* Small title bars and the theme's buttons, flat. */
  .phone-skin-flat .element_smalltitle {
    border: 1px solid #363224;
    background-color: #0f0f0d;
  }

  .phone-skin-flat .element_smalltitle::before,
  .phone-skin-flat .element_smalltitle::after,
  .phone-skin-flat .element_button::before,
  .phone-skin-flat .element_button::after {
    content: none;
  }

  .phone-skin-flat .element_button {
    border-color: #59534c;
    background-color: #2a2720;
  }

  .phone-skin-flat .phone-online-dot {
    border-radius: 50%;
  }

  /* Footer: muted, 12px in. */
  .phone-skin-flat #page-footer {
    padding: 16px 12px 24px;
    color: #858176;
  }

  .phone-skin-flat #page-footer .left,
  .phone-skin-flat #page-footer .right {
    color: #858176;
  }

  /* The account sheet: rounded top with a handle. */
  .phone-skin-flat .account-sheet {
    padding-top: 22px;
    border-radius: 14px 14px 0 0;
  }

  .phone-skin-flat .account-sheet::before {
    content: '';
    position: absolute;
    top: 8px;
    left: calc(50% - 20px);
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background-color: #4d4845;
  }
}
