:root {
  color-scheme: light;
  --background: #f8f8f8;
  --text: #353535;
  --text-light: #35353530;
  --text-background: #ffffff;
  --link: #007db8;
  --button-accent: #003c58;
  --border: #f0f0f0;
  --shadow: #cccccc;
  /* Safe areas. Zero on desktop, non-zero around notches and home indicators. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* Dark mode */
:root .theme-dark {
  color-scheme: dark;
  --background: #000000;
  --text: #d8d8d8;
  --text-light: #d8d8d830;
  --text-background: #181818;
  --link: #83d7ff;
  --button-accent: #376e88;
  --border: #222222;
  --shadow: #111111;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: normal;
  src: local('Inter'),
       url('/css/fonts/Inter-Regular.woff2') format('woff2'),
       url('/css/fonts/Inter-Regular.woff') format('woff');
}

html {
  width: 100%;
  height: 100%;
  /* Matches the theme so rubber-band overscroll doesn't flash white. */
  background-color: var(--background);
}

body {
  box-sizing: border-box;
  font-family: Inter, Arial, sans-serif;
  background-color: var(--background);
  color: var(--text);
  margin: 10px;
  margin-left: calc(10px + var(--safe-left));
  margin-right: calc(10px + var(--safe-right));
  padding: 0;
  font-size: 17px;
  /* Installed-app feel: no accidental pull-to-refresh, no blue tap flash. */
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

/* Chrome shouldn't behave like selectable document text. */
header,
.navigation,
.action-bar,
.settings-nav,
.button,
button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p, ul, ol {
  margin: 0;
  padding: 0;
  font-weight: normal;
}

hr {
  border: none;
  border-bottom: 1px solid var(--shadow);
  margin: 50px 0;
}

button {
  font: inherit;
  appearance: none;
  outline: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  margin: 20px 0 10px 0;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.4rem;
}

ul {
  padding: 0 0;
  padding-left: 20px;
  font-size: 1rem;
}

li {
  margin: 10px 0;
  padding-left: 0;
  line-height: 1.35rem;
}

img {
  max-width: 100%;
  height: auto;
}

pre {
  overflow: auto;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  opacity: .7;
}

a.external {
  font-size: .8rem;
}

input[type="text"], input[type="email"], input[type="number"], input[type="password"], .input {
  appearance: none;
  border: none;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  /* min-width: 300px used to force horizontal overflow on narrow phones. */
  width: 100%;
  max-width: 300px;
  min-width: 0;
  box-shadow: 0 1px 8px var(--shadow);
  font-size: 1rem;
  color: var(--text);
  background-color: var(--text-background);
  font-family: inherit;
}

select, textarea {
  border: none;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  width: 100%;
  max-width: 300px;
  box-shadow: 0 1px 2px var(--shadow);
  font-size: 1rem;
  color: var(--text);
  background-color: var(--text-background);
  font-family: inherit;
}

header {
  display: flex;
  max-width: 800px;
  margin: 10px auto 20px auto;
  padding: 10px 0;
  justify-content: space-between;
  align-items: center;
}

#header-mobile {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 1;
  display: none;
}

#header-mobile header {
  bottom: 0;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  /* Clear the iOS home indicator / Android gesture bar. */
  padding-bottom: calc(10px + var(--safe-bottom));
  padding-left: calc(10px + var(--safe-left));
  padding-right: calc(10px + var(--safe-right));
  background: var(--text-background);
  border: 1px solid var(--border);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  box-shadow: 0 1px 8px var(--shadow);

}

header .naf-logo {
  font-size: 1.5rem;
}

header .naf-logo a {
  color: var(--text);
}

header .naf-logo span {
  opacity: .7;
}

header .header-right {
  display: flex;
  align-items: center;
  position: relative;
}

header .logged-in-user a {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

header .theme-icon {
  width: 30px;
  height: 30px;
  margin-right: 20px;
}

header svg {
  fill: url(#MyGradient);
}

#header-mobile header svg {
  fill: url(#MyGradient1);
}

.theme-editor-wrapper {
  display: none;
  position: fixed;
  width: 100%;
  top: 5%;
  left: 0;
  z-index: 1;
}

.theme-editor {
  width: 95%;
  max-width: 500px;
  margin: 0 auto;
  z-index: 1;
  padding: 20px;
  color: #ffffff;
  box-shadow: 0 1px 8px var(--shadow);
  border-radius: 28px;
  background: linear-gradient(-45deg, #3f5efb 0%, #fc466b 100%);
  position: relative;
  opacity: .95;
}

.theme-editor label {
  width: 42px;
  display: inline-block;
  font-size: 2rem;
  text-align: center;
}

.theme-editor h3 {
  margin: 0 0 10px 0;
  text-align: center;
}

.theme-editor svg {
  max-width: 35px;
}

.theme-editor hr {
  opacity: .35;
  margin: 10px 0;
}

.theme-editor .theme-options {
  display: flex;
  justify-content: space-around;
}

.theme-editor input[type="radio"] {
  height: 25px;
  width: 25px;
  border-radius: 50%;
  margin: 0;
}

.theme-editor .custom-theme label {
  font-size: 1.2rem;
  margin-bottom: 10px;
  width: auto;
}

.theme-editor .custom-theme > label {
  width: 50px;
  vertical-align: middle;
}

.theme-editor .custom-theme input[type="color"] {
  margin: 5px 10px 5px 0;
}

.theme-editor .custom-theme-buttons {
  text-align: right;
}

.theme-editor .custom-theme-buttons .button {
  display: inline-block;
  margin-left: 20px;
}

.theme-editor .custom-theme-buttons #custom-theme-reset {
  cursor: pointer;
}

.theme-editor .hide-features-box label {
  font-size: 1rem;
  width: auto;
}

.theme-editor .hide-features-box {
  text-align: center;
}

#theme-editor-close {
  cursor: pointer;
  font-size: 1.7rem;
  display: inline-block;
  position: absolute;
  right: 15px;
  top: 0;
  width: 20px;
  height: 20px;
  text-align: center;
}

footer {
  font-size: .8rem;
  max-width: 800px;
  display: flex;
  margin: 0 auto;
  margin-top: 50px;
  padding-bottom: 80px;
  justify-content: space-between;
  align-items: center;
}

footer .footer-links a {
  margin-left: 20px;
}

.noscript {
  position: fixed;
  left: 0;
  bottom: calc(3% + var(--safe-bottom));
  opacity: .7;
  font-size: .9rem;
  text-align: center;
  width: 100%;
}

.small {
  font-size: .9rem;
  opacity: .8;
}

/* Push opt-in. Hidden until main.js confirms the browser supports it. */
body > .notification-toggle-wrapper {
  text-align: center;
  margin: 40px 0 10px 0;
}

body > .notification-toggle-wrapper .notification-toggle {
  font-size: .9rem;
  opacity: .8;
  color: var(--link);
  text-decoration: underline;
}

.notification-toggle[disabled] {
  cursor: default;
  opacity: .5;
  text-decoration: none;
}

.banner {
  text-align: center;
  margin: 30px 0;
}

.banner h2 {
  margin-top: 10px;
}

.button {
  cursor: pointer;
  display: block;
  background-color: var(--link);
  color: var(--text-background);
  font-size: .9rem;
  padding: 8px 18px;
  border: none;
  border-radius: 28px;
  border-bottom: 2px solid var(--button-accent);
}

.button:active {
  background-color: var(--button-accent);
}

.button[href="/#disabled"] {
  pointer-events: none;
  opacity: .3;
}

.button.alt {
  background-color: var(--text-background);
  color: var(--link);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px var(--shadow);
}

.button.alt:active {
  background-color: var(--shadow);
  border: 1px solid var(--shadow);
}

.button.full-width {
  width: 100%;
}

.button.small {
  font-size: .8rem;
  padding: 2px 8px;
}

.info {
  text-align: right;
  position: absolute;
  right: 0;
  top: -20px;
}

.info .show-info {
  background-color: var(--text-background);
  border: 1px solid var(--border);
  padding: 0 7px;
  border-radius: 50%;
}

.info .info-content {
  display: none;
  margin-top: 10px;
  text-align: left;
  max-width: 300px;
  background-color: var(--text-background);
  padding: 10px 15px;
  font-size: .7rem;
  border-radius: 8px;
  box-shadow: 0 1px 8px var(--shadow);
  line-height: 1rem;
}

.info:hover .info-content {
  display: block;
}

.financial {
  margin: 30px auto;
  max-width: 800px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: .9rem;
}

.financial > div {
  padding: 0 5px;
}

.financial span.pos {
  color: green;
}

.financial span.neg {
  color: red;
}

.day > h1 {
  margin-top: 50px;
  font-weight: bold;
}

.day > h2 {
  margin-top: 30px;
}

article {
  margin-bottom: 20px;
  padding: 20px;
  background-color: var(--text-background);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 8px var(--shadow);
  position: relative;
}

article .content {
  line-height: 1.5rem;
}

article .related {
  margin-top: 10px;
}

article .related span {
  display: inline-block;
  margin: 10px 10px 0 0;
  border-bottom: 1px solid var(--shadow);
  background-color: var(--background);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: .9rem;
}

article .date {
  display: none;
}

article .category {
  display: none;
}

article .sources {
  display: inline-block;
}

.action-bar {
  margin-bottom: -10px;
  padding-top: 10px;
  font-size: .8rem;
  text-align: right;
}

.action-bar span {
  padding: 0 5px;
}

.action-bar form {
  display: inline-block;
}

.action-bar button {
  color: var(--link);
}

.reading-time {
  margin-top: -5px;
}

.wrapper {
  max-width: 800px;
  width: 100%;
  min-height: 350px;
  margin: 0 auto;
  position: relative;
}

.settings-box .name-email-pwd {
  max-width: 300px;
}

.settings-box .button {
  display: inline-block;
}

.settings-box p {
  margin-top: 20px;
}

.settings-box hr {
  margin: 20px 0;
}

.settings-box h2 .button {
  display: inline-block;
  margin-left: 10px;
  vertical-align: text-bottom;
  padding: 5px 15px;
}

.name-email-pwd, .daily-digest, .billing,
.market-tickers, .help-feature-request {
  display: none;
}

.settings .help-feature-request {
  background-color: var(--text-background);
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 8px var(--shadow);
  margin: 20px 0;
  padding: 20px;
}

.settings .help-feature-request form label {
  margin: 5px 0;
}

.settings .help-feature-request form textarea {
  width: 100%;
  max-width: 500px;
  min-height: 100px;
}

.settings-box #manage-billing-form {
  max-width: 300px;
  margin: 20px 0;
}

.settings-box .daily-digest {
  display: flex;
  align-items: center;
  margin-top: 20px;
}

.settings-box .daily-digest label {
  display: inline-block;
  margin: 0 10px;
}

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--link);
}

input:focus + .slider {
  box-shadow: 0 0 1px #ccc;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}


.input-error {
  display: none;
  margin-top: 10px;
  color: red;
}

.wrapper .settings-nav {
  display: flex;
  width: 95%;
  max-width: 500px;
  margin: 0 auto;
  justify-content: space-around;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--text-light);
}

.wrapper .settings-nav span {
  padding-top: 5px;
  border-top: 2px solid transparent;
}

.wrapper .settings-nav .selected,
.wrapper .settings-nav span:hover {
  border-top: 2px solid var(--link);
}

.pass-reset {
  margin-top: 50px;
}

.pass-reset, .pass-reset form {
  max-width: 300px;
}

.pass-reset form h3 {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pass-reset form label {
  display: block;
  margin: 20px 0 10px 0;
}

.pass-reset form button {
  margin-top: 20px;
}

.contact form {
  margin: 0 auto;
  max-width: 310px;
}

.contact form label {
  display: block;
  margin: 20px 0 5px 0;
}

.contact form button {
  margin-top: 10px;
}

.contact form textarea {
  min-height: 150px;
}

.contact form #hScore {
  position: fixed;
  top: -99999px;
}

.search-box {
  margin: 0 auto;
}

.search-box form {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.search-box form > * {
  margin: 0 5px;
}

.search-box form input {
  min-width: 0;
  width: 300px;
  max-width: 70%;
}

.search-results h1 span {
  font-size: .9rem;
  margin-left: 5px;
}

.wrapper.my-saved h1 {
  margin-bottom: 20px;
}

.wrapper .news-info {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.wrapper.my-saved .content {
  margin-top: 5px;
}

.wrapper .news-info > span {
  margin-bottom: 5px;
  font-size: .8rem;
}

.wrapper.single-news .link-box {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background-color: var(--text-background);
  overflow: auto
}

.wrapper.single-news .link-box input {
  box-shadow: none;
  border: none;
  font-size: 1rem;
  width: calc(100% - 70px);
  min-width: 0;
  font-family: monospace;
}

.wrapper.embed article .content {
  margin-top: 5px;
}

textarea.embed-code {
  width: 100%;
  max-width: none;
  min-height: 100px;
  margin-top: 10px;
  font-family: monospace;
}

.navigation {
  width: 100%;
  max-width: 350px;
  margin: 20px auto;
  display: flex;
  justify-content: space-between;
}

.create-account .input-error,
.sign-up-in .input-error {
  max-width: 300px;
}

.sign-up-in {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.sign-up-in label, .settings label {
  display: block;
  margin: 20px 0 5px 0;
}

.sign-up-in form > div, .settings form > div {
  margin-bottom: 20px;
}

.sign-up-box, .sign-in-box {
  margin: 0 auto;
  padding: 0 10px;
  margin-bottom: 20px;
}

.sign-up-box {
  max-width: 50%;
}

.sign-up-content {
  padding: 20px;
  background-color: var(--text-background);
  border-radius: 28px;
  box-shadow: 0 1px 8px var(--shadow);
}

.sign-up-content > div {
  margin: 8px 0;
}

.sign-up-content h1 {
  margin: 0 0 10px 0;
}

.sign-up-content button {
  margin: 20px 0;
}

.strikethrough {
  text-decoration: line-through;
  opacity: .8;
}

.sale-percent {
  color: #ffffff;
  background-color: green;
  padding: 0 5px;
  border-radius: 8px;
}

.price {
  font-weight: bold;
  font-size: 1.2rem;
}

.about h1, .terms-privacy h1 {
  font-size: 2rem;
  margin-top: 50px;
}

.about p {
  font-size: 1.5rem;
  margin: 20px 0;
  line-height: 2.3rem;
}

.terms-privacy p {
  font-size: 1.2rem;
  line-height: 1.8rem;
  margin: 10px 0;
}

.terms-privacy h2 {
  font-size: 1.6rem;
  margin-top: 30px;
}

.terms-privacy ul {
  padding-left: 50px;
}

.terms-privacy ul li {
  font-size: 1.2rem;
  line-height: 1.8rem;
}

.terms-privacy ul.large-list {
  margin-top: 20px;
}

.terms-privacy ul.large-list li {
  font-size: 1.5rem;
  line-height: normal;
}

#message-box {
  display: none;
  position: fixed;
  left: 0;
  bottom: calc(10% + var(--safe-bottom));
  width: 100%;
  z-index: 90;
}

#message-box-wrapper {
  max-width: 95%;
  width: 600px;
  margin: 0 auto;
  border: 1px solid var(--link);
  background-color: var(--text-background);
  padding: 15px 20px;
  box-shadow: 0 1px 8px var(--shadow);
  border-top: 5px solid var(--link);
  border-radius: 8px;
  position: relative;
  opacity: .95;
}

#message-box-text {
  margin: 0 0;
  line-height: 1.5rem;
}

#message-box-close {
  cursor: pointer;
  font-size: 1.7rem;
  display: inline-block;
  position: absolute;
  right: 2px;
  top: 0;
  width: 20px;
  height: 20px;
  text-align: center;
}

#message-box-wrapper.error {
  border: 1px solid red;
  border-top: 5px solid red;
}

#message-box-close div {
  margin-top: -5px;
}


/* Responsive styles - phones */
@media screen and (max-width: 600px) {
  body {
    font-size: 15px;
    margin: 10px;
    margin-left: calc(10px + var(--safe-left));
    margin-right: calc(10px + var(--safe-right));
    /* Clear the fixed bottom nav bar plus the home indicator so the footer
       is never trapped underneath it. */
    padding-bottom: calc(75px + var(--safe-bottom));
  }

  article {
    padding: 10px;
  }

  article .action-bar {
    margin-bottom: -5px;
  }

  header#header-wide {
    display: none;
  }

  #header-mobile {
    display: inherit;
  }

  header .naf-logo {
    font-size: 1.2rem;
  }

  header .logged-in-user {
    max-width: 135px;
    font-size: .9rem;
  }

  header .logged-in-user .button {
    font-size: .9rem;
  }

  .theme-editor-wrapper {
    top: auto;
    bottom: 10%;
  }

  header .theme-icon {
    width: 25px;
    height: 25px;
    margin-right: 10px;
  }

  footer {
    display: block;
    text-align: center;
  }

  footer .footer-links {
    margin-top: 20px;
  }

  .banner h2 {
    font-size: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .financial {
    font-size: .7rem;
  }

  .settings-nav {
    font-size: .9rem;
  }

  .settings-box {
    margin: 0 auto;
  }

  .about p {
    font-size: 1.35rem;
    line-height: 2rem;
  }

  .sign-up-box {
    max-width: 100%;
  }

  footer .footer-links a {
    margin-left: 10px;
  }
}


/* Responsive styles - tiny phones */
@media screen and (max-width: 350px) {
  .button {
    padding: 8px 10px;
  }
}


/* Responsive styles - tablets */
@media screen and (max-width: 800px) {
  .sign-up-box {
    max-width: 100%;
  }
}
